sizeof operator
- sizeof operator is used to calcualte the size of data type or variables.
- sizeof operator can be nested.
- sizeof operator will return the size in integer format.
- sizeof operator syntax looks more like a function but it is considered as an operator in c programming
Example of sizeof() operator
Size of Variables
#include<stdio.h> int main() { int ivar = 100; char cvar = 'a'; float fvar = 10.10; printf("%d", sizeof(ivar)); printf("%d", sizeof(cvar)); printf("%d", sizeof(fvar)); return 0; }
No comments:
Post a Comment