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!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
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 Réponse
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
Aujourd'hui en vedette
Help
0 Votes
About code
1 Votes
help
0 Votes
Recursion
0 Votes