Why size of varible var returns a value of 4? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why size of varible var returns a value of 4?

I have a silly doubt. Actually the variable "var" is an integer which has value of 50. And 50 is an integer. So if sizeof integer is 2 why 50 gives sizeof as 4?

25th Jan 2018, 9:06 AM
Amit Kumar
Amit Kumar - avatar
1 Answer
+ 1
Size of integer depends on the compiler, but in most cases, it it 4.
25th Jan 2018, 11:00 AM
Jacob Pembleton
Jacob Pembleton - avatar