The C Programming Language is the best textbook for a beginner who wants to learn C. This article mostly talks about pointers and memory in C.

C’s syntax is simple but handling pointers in C is too easy to get stuck.

Primitive data types and sizes

char, int, float, double

signed, unsigned, short, long

constant

1
2
3
printf("%u\n", sizeof(int));
printf("%u\n", sizeof(char));
printf("%u\n", sizeof(float));

Array

Array is a continuous fixed-length address. Different data types have different sizes. sizeof returns the size(how many bytes it holds to represent a data) of a data.