c - sizeof operator returning different output. why? -
this question has answer here:
- sizeof float (3.0) vs (3.0f) 3 answers
while using sizeof operator , sizeof (0.7) printed 8 , storing same number floating point variable a = 0.7 , using sizeof(a) printed 4. why so?
size of not function, , eveluated during compilation.
sizeof 0.7
gives size of double
constant double
sizeof 0.7f
gives size of float
f
@ , informs compiler constant float
your variable a
float , assignment converts double constant float
Comments
Post a Comment