sizeof operator in c
sizeof operator in c, returns the size of following:
- Variables data type
- Data type.
Syntax
sizeof(data-type);
sizeof(variable-name);
Example
#include<stdio.h>
void main()
{
int a = 20;
// variable of variable according to its data type
printf("Size of integer variable is %d - ", sizeof(a));
// Data type size
printf("Size is %d - ", sizeof(float));
}