Group | Type Names | Comments |
---|---|---|
character | char | Characters represented by values between 0 and 255, size is 8 bits | Integer |
int8_t uint8_t int16_t uint16_t int32_t uint32_t |
signed integer (byte),width of 8 bits, value range of -128 to +127 unsigned integer (byte), width of 8 bits, value range of 0 to 255 signed integer (int), width of 16 bits, value range of -32768 to 32767 unsigned integer(int), width of 16 bits, value range of 0 to 65535 signed integer (long), width of 32 bits , value range of -2147483648 to 2147483647 unsigned integer (long), width of 32 bits, value range of 0 to 4294967295 |
Floating-point (1) | float double |
32 bit size with values ranging from 1.175494351e-38 to 3.40282347e+38 64 bit size with values ranging from 2.22507385850720138e-308 to 1.79769313486231571e+308 |
Void | no storage | Boolean | bool | size of 8 bits with values of 0 (false) or 1 (true) |
Null pointer | All pointers have a size of 32 bits |
int8_t is prefered over int because it explicitly defines the width of the variable in bits (8-bits in this case). Int will vary in size depending on the microcontroller chip (8-bit, 16-bit, 32-bit, etc.). The same applies for byte, int, long, etc.
(1) Double is preferred over float because it provides 2x more precision. Floats are faster than doubles, and they use less memory. See also fixed width floating-point types (float#_t).
Sitemap | Copyright © 2017 - 2024 Mechatronic Solutions LLC
Web site by www.MechatronicSolutionsLLC.com | | 30.0310 ms