In C/C++ sizeof() operator is used to find size of a date type or variable. Expressions written in sizeof() are never executed.
Even if we assign a value inside sizeof(), the changes are not reflected.
Output: a = 5, b = 4
This article is contributed by Nishu Singh. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- # and ## Operators in C
- ispunct() function in C
- C program to print a string without any quote (singe or double) in the program
- strspn() function in C
- Difference between set, multiset, unordered_set, unordered_multiset
- Difference between while(1) and while(0) in C language
- lvalue and rvalue in C language
- Difference between strlen() and sizeof() for string in C
- Execution of printf with ++ operators
- sizeof operator in C
- Difference between ++*p, *p++ and *++p
- Sequence Points in C | Set 1
- Modulus on Negative Numbers
- Operands for sizeof operator
- Write a C macro PRINT(x) which prints x