Re: data types



Hi Guys,
i just want to extend the topic a little further.....
what governs the size of a data type? is it the computer architecture
or the compiler which is generating the executable code for a
particular architecture?
Also, does the compiler take care of the endianness of the machine?
What is the case with a cross compiler in such situations?

thanx.
rk.
koolj96825@xxxxxxxxx wrote:
Hi,

I've been working on this project for the past few months in my spare
time, and now I started working on the windows interface and going
over my petzold book, I've come to the realization that an int could
be 32-bit for PCs. Oh, I could kick myself for not checking good in
the beginning, but the manual for the compiler I am using says int is
16-bit. It may be out of date.

Anyway, now that I need to go back over and look closely at my code,
my question is: is there a way to declare a variable say a 16 bit
unsigned integer in C? Or is declaring it "short" the only specifier
that may work?

Thanks in advance

.



Relevant Pages

  • Re: int or long int?
    ... depending on "implicit int" is considered poor ... why your compiler warned you about it (unless you're using one of the ... declare the variable as int. ...
    (comp.programming)
  • Re: int or long int?
    ... depending on "implicit int" is considered poor ... why your compiler warned you about it (unless you're using one of the ... declare the variable as int. ...
    (comp.programming)
  • Re: Static vs. Dynamic typing (big advantage or not)---WAS: c.programming: OOP
    ... It could be - but just why you should want to declare something as, ... just declare everything as int or long. ... In both cases, you're saying something ... In my current compiler, int and long are the same size. ...
    (comp.object)
  • Re: Static vs. Dynamic typing (big advantage or not)---WAS: c.programming: OOP
    ... It could be - but just why you should want to declare something as, ... just declare everything as int or long. ... In both cases, you're saying something ... In my current compiler, int and long are the same size. ...
    (comp.programming)
  • Re: Warning comes when using Unions
    ... When I add data types before each one, ... int x, y; ... His approach is the one I normally use for embedded work, where the compiler ... over to the next byte automatically and if you declare fewer than the number of ...
    (comp.lang.c)