Why size of varible var returns a value of 4? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 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 Antwort
+ 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