From: Adam Beneschan <adambeneschan@aol.com>
Subject: Re: Passing a String to a C/C++ Subprogram (Special Case)
Date: Wed, 16 Oct 2013 13:48:11 -0700 (PDT)
Date: 2013-10-16T13:48:11-07:00 [thread overview]
Message-ID: <12b085dd-8e96-477e-bbf3-135330275b69@googlegroups.com> (raw)
In-Reply-To: <14357314-5521-4275-9949-9ea42c790147@googlegroups.com>
On Wednesday, October 16, 2013 1:17:32 PM UTC-7, sbelm...@gmail.com wrote:
> Is it not also true that an Ada Character is not necessarily the same mapping as a C char? If the C program has to output the glyphs and not just deal with the bytes, I would think it would be subject to things like the current code page, etc.
While that may be true, I don't know that it means much of anything. The meaning of a "char" in C is whatever the person writing the code intended it to mean. "char" types are the only 8-bit integer types in C, so a "char" can be used to represent a byte from a binary file, a character in the Latin-1 character set, a character in some other 256-character subset of Unicode, a portion of a multi-byte character in the UTF-8 representation of a character, a Boolean value, or anything else that fits in 8 bits. So you can't take anything for granted and you pretty much have to know what you're doing, which is the case any time you're working with C anyway. Hopefully we can presume that Eryndlia has already thought about this and knows what values the C code she's interfacing to is expecting to be in those bytes.
-- Adam
next prev parent reply other threads:[~2013-10-16 20:48 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-15 19:54 Passing a String to a C/C++ Subprogram (Special Case) Eryndlia Mavourneen
2013-10-15 20:11 ` Adam Beneschan
2013-10-15 21:02 ` Eryndlia Mavourneen
2013-10-16 7:17 ` Dmitry A. Kazakov
2013-10-16 15:14 ` Jeffrey Carter
2013-10-16 17:32 ` Martin
2013-10-16 17:42 ` Eryndlia Mavourneen
2013-10-16 17:54 ` Martin
2013-10-16 18:13 ` Eryndlia Mavourneen
2013-10-16 19:40 ` Simon Wright
2013-10-16 20:02 ` Eryndlia Mavourneen
2013-10-19 2:11 ` Randy Brukardt
2013-10-16 19:11 ` Adam Beneschan
2013-10-16 21:31 ` Martin
2013-10-16 21:41 ` Adam Beneschan
2013-10-16 23:15 ` Martin
2013-10-15 20:59 ` Jeffrey Carter
2013-10-15 21:13 ` Eryndlia Mavourneen
2013-10-15 22:19 ` Shark8
2013-10-16 0:00 ` Jeffrey Carter
2013-10-17 9:55 ` Georg Bauhaus
2013-10-16 20:17 ` sbelmont700
2013-10-16 20:48 ` Adam Beneschan [this message]
2013-10-17 13:05 ` Eryndlia Mavourneen
2013-10-17 13:58 ` sbelmont700
2013-10-17 16:28 ` Eryndlia Mavourneen
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox