Title: | AMIGA NOTES |
Notice: | Join us in the *NEW* conference - HYDRA::AMIGA_V2 |
Moderator: | HYDRA::MOORE |
Created: | Sat Apr 26 1986 |
Last Modified: | Wed Feb 05 1992 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 5378 |
Total number of notes: | 38326 |
Can anyone tell me what is the usual length of an 'int' for the standard C compilers on the AMiga? I've been playing with PDC for a few months now, and despite its quirky bugs, it seems to work reasonably well. More recently, I've got a copy of the Sozobon (ZC) compiler. The problem with that, is that it uses 16 bit integers. 32 bit values have to be declared as 'long' or coerced to long type. This is in contrast to PDC (and VAX/C of course!). I'd be interested to know what the other compilers do.
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
2711.1 | ANT::JANZEN | cf. ANT::CIRCUITS,ANT::UWAVES | Wed Jul 05 1989 09:44 | 6 | |
lattice c 5.0 defaults char is 1 byte int is 4 bytes float is 4 bytes. I think there is a long float that is 8 bytes. Tom | |||||
2711.2 | LEVERS::PLOUFF | Glorious Blossoms -- Ah-ah-ah-choo! | Wed Jul 05 1989 10:19 | 7 | |
Manx C 3.6a defaults char is 1 byte int is 2 bytes However, there is a compiler option and a complete set of libraries for 32-bit (i.e. 4-byte) ints, and many people use this option as standard procedure. | |||||
2711.3 | No standard about that | FROCKY::BOFFO | Tue Feb 06 1990 10:42 | 15 | |
How long is an int ... You should write your programms that this does not make any difference. The only thing which is sure, is that 'long' is not smaller than 'short'. There is no further standard about that. If you need exactly 2 bytes take 'short int'. If you need exactly 4 bytes take 'long int' or 'char[ 4 ]'. You can find out the lenght with: printf( "%d", sizeof( int ) ); Thomas |