Tsallaka zuwa abun ciki
Justice Tech School

Integer Types and Limits

C has char, short, int, long and long long, each signed or unsigned. <stdint.h> provides exact sizes such as int32_t and uint8_t, and <limits.h> gives limits.

Example
#include <stdint.h>
#include <limits.h>
printf("%d %u\n", INT_MAX, UINT_MAX);
int32_t a = -5; uint8_t b = 250;
b += 10;
printf("%d %d %zu\n", a, b, sizeof(int64_t));

Result

2147483647 4294967295
-5 4 8

Exercise

Fixed size 32 bit signed type.

 x;

Quiz Test

What happens when unsigned overflows?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.