Data Types and Sizes in the C Programming Language

  • int:  16 or 32 bits – the natural size for a particular machine, decide by compiler
  • short int: 16 bits
  • long int: >= 32 bits
  • signed int:
  • unsigned int:
  • char: 8 bits
  • signed char:  -128 ~ 127
  • unsigned char:  0 ~ 255 (2^8 -1)
  • float
  • double
  • long double

The standard headers <limits.h> and <float.h>(maybe does not exists any more) contain symbolic constants for all of these size

usually you can find limits.h in /usr/include

 

Leave a Reply

Your email address will not be published. Required fields are marked *