printf("%ld", sizeof(main())) in this statement if we place %f then output will be 0.000. Why the value is 0.000 ? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

printf("%ld", sizeof(main())) in this statement if we place %f then output will be 0.000. Why the value is 0.000 ?

Why we get the value of float like that

6th Oct 2020, 3:53 AM
PUCHA SRINIVASA PAVAN
1 Resposta
0
I would guess it's because `sizeof` operator returns a `size_t` (https://en.cppreference.com/w/c/types/size_t) and conversion from `size_t` type into `float` just won't work as smoothly as we would expect.
6th Oct 2020, 3:59 AM
Ipang