Hmmm..... Oh sweet heavens. I think you're right. Okay. I need a few hours (or days) to let think sink into my thick skull.
Hmmm..... Oh sweet heavens. I think you're right. Okay. I need a few hours (or days) to let think sink into my thick skull.
Interesting... Same code:
Results from two compilers (emphasis mine):Code:#include <stdio.h> int main() { printf("size of int: %i\n", sizeof(int)); printf("size of long: %i\n", sizeof(long)); printf("size of long long: %i\n", sizeof(long long)); printf("size of long long int: %i\n", sizeof(long long int)); return 0; }
Compiler 1:
size of int: 2
size of long: 4
size of long long: 4
size of long long int: 4
Compiler 2:
Error E2176 x.c 7: Too many types in declaration in function main
Error E2176 x.c 8: Too many types in declaration in function main
*** 2 errors in Compile ***
Not the results you got
Definition: Politics -- Latin, from
poly meaning many and
tics meaning blood sucking parasites
-- Tom Smothers
Yea I didn't mean to provide some production code, just trying to demonstrate the concept. I'm running an i686 with the 2.6.15-gentoo-r1 linux kernel and compiled with gcc 3.4.5. Systems like mine will always get the same result, but may very on other systems.
> "In addition; there are a number of qualifiers that can be applied to these basic data types. short and long apply to integers".
I think what it's trying to say is that you can't have for example
long char foo;
short double bar;
Whereas with qualifiers you can have
volatile char foo;
const double bar;
long and short only apply to integers, not chars, floats, doubles or pointers.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.