Keil Logo

Data Storage Formats

The CARM C Compiler offers a number of basic data types to use in your C programs. The following table lists these data types along with their size requirements and value ranges.

Data Type Bits Bytes Alignment Value Range
signed char1 8 1 1 -128 to +127
unsigned char 8 1 1 0 to 255
signed short1 16 2 2 -32768 to +32767
unsigned short 16 2 2 0 to 65535
enum2 32 4 4 -2147483648 to +2147483647
signed int1 32 4 4 -2147483648 to +2147483647
unsigned int 32 4 4 0 to 4294967295
signed long1 32 4 4 -2147483648 to +2147483647
unsigned long 32 4 4 0 to 4294967295
signed long long1 64 8 4 -263 to +263-1
unsigned long long 64 8 4 0 to 264-1
float 32 4 4 ±1.175494E-38 to ±3.402823E+38
double 64 8 4 ±1.7-308 to ±1.7E+308
pointer 32 4 4 32-bit Address

Note

  1. Signed types are stored in two's complement.
  2. The enum type is stored using the shortest signed or unsigned integer type required to contain its value.

Other data types, like structures and unions, may contain scalars from this table.

Related Knowledgebase Articles

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.