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


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.....



Relevant Pages

  • Re: VB6, VB2005, or Something Else?
    ... When using a string within MS Basic for example you do not know how it is maintained nor should you. ... I more referred to the variables which don't have a specified type, which automatically convert to any native data type. ... That is perhaps a language issue, rather a COM issue, but let's say - this data types are behaving like a COM variant in C++. ... But the main reason is that the platforms are very different and need different coding to get the most out of them. ...
    (microsoft.public.vb.general.discussion)
  • Re: object and Object
    ... to some other programming language rather than .NET/C#. ... Somehow I got an impression from somewhere before(Maybe another programming ... that String represent an object data type and string just ... Microsoft MSDN Online Support Lead ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: object and Object
    ... to some other programming language rather than .NET/C#. ... Somehow I got an impression from somewhere before(Maybe another programming ... that String represent an object data type and string just ... Microsoft MSDN Online Support Lead ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Visual Basic 2005
    ... > in the original language. ... VB.Net with 16-bit data type called "Integer" by the VB.Net IDE and compiler ... Office still supports VBA as it has been and I ... suspect there's some really strong support at MS to continue that. ...
    (microsoft.public.vb.general.discussion)
  • Re: Other than php/perl/lisp/c/c++/java, anybody have a favorite computer-programming language?
    ... Rather than have a separate "cookbook" for each language, ... handle that single data type included side by side. ... one approach, while a language with implicit indirection (Java, ... C#, Scheme, Python, etc.) will support a different approach. ...
    (comp.programming)