Re: Is there a integer data type of one byte in gcc?
From: John H. Guillory (johng_at_mlc-hosting.net)
Date: 11/12/03
- Next message: Richard Heathfield: "Re: unsigned long long"
- Previous message: Scott Fluhrer: "Re: free an array..."
- Next in thread: John H. Guillory: "Re: Is there a integer data type of one byte in gcc?"
- Maybe reply: John H. Guillory: "Re: Is there a integer data type of one byte in gcc?"
- Reply: Keith Thompson: "Re: Is there a integer data type of one byte in gcc?"
- Reply: Robert Wessel: "Re: Is there a integer data type of one byte in gcc?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 11 Nov 2003 21:58:39 -0600
On 21 Oct 2003 11:37:00 GMT, Joona I Palaste <palaste@cc.helsinki.fi>
wrote:
>char is guaranteed to be at least 8 bits wide on every platform. If the
>OP wants a type that is exactly 8 bits wide, then I would want to know
>why.
>
>> Is uint8_t guaranteed to be 8 bits wide on every platform?
>
>I'd figure so, on platforms that support it in the first place.
I'm not 100% sure that a char isn't *ALWAYS* 8-bits. For the most
part, writing C code to depend upon the size of a given data type is
rather risky. It can change at a moments notice with a compiler
upgrade. Everything's pretty much based off the int's being the
natural machine word size, which is 16 for DOS days, 32 for Windows'95
days, 64 for VAX VMS, and other mini-computers, etc... If you want a
language that can guarantee your data file will always be 20 megs per
record, program in COBOL. Otherwise, if you want a language that can
give you the power to write small and fast databases, then use C....
In order to make C work the same on so many platforms, C must be
flexible enough to be able to meet every computers needs, not just
intel based cpus.....
- Next message: Richard Heathfield: "Re: unsigned long long"
- Previous message: Scott Fluhrer: "Re: free an array..."
- Next in thread: John H. Guillory: "Re: Is there a integer data type of one byte in gcc?"
- Maybe reply: John H. Guillory: "Re: Is there a integer data type of one byte in gcc?"
- Reply: Keith Thompson: "Re: Is there a integer data type of one byte in gcc?"
- Reply: Robert Wessel: "Re: Is there a integer data type of one byte in gcc?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|