c - sizeof operator returning different output. why? -


this question has answer here:

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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -