S
srivatsan_b
Can anybody please explain how sizeof operator is implemented?
Thanks in advance
Srivatsan B
Thanks in advance
Srivatsan B
Can anybody please explain how sizeof operator is implemented?
In traditional C it looks like a function but isn't. sizeof(int) resolves tosrivatsan_b said:Can anybody please explain how sizeof operator is implemented?
Can anybody please explain how sizeof operator is implemented?
Thanks in advance
Srivatsan B
srivatsan_b said:Can anybody please explain how sizeof operator is implemented?
Malcolm said:In traditional C it looks like a function but isn't. sizeof(int) resolves to
a compile time constant, which the compiler cna do because it knows the
number of bytes taken for each type.
(You cannot portably replace with a constant in code because int may be 2, 4
or sometimes even a different number of bytes on different machines).
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.