+ 1
How come this output?
Recently i have encountered with this program and i have no idea that how it is printing "bye". Somebody please explain this to me https://code.sololearn.com/c6JWI490p8i8/?ref=app
4 Réponses
+ 2
RUSHIKESH S. I don't know very much how this works under the hood but the reason seems to be that sizeof returns an unsigned int (long int).
Try this:
if( (int)sizeof (a) > a)
+ 1
Kevin Star thank you for your help...😊
+ 1
Here is more detail:
https://stackoverflow.com/questions/3642010/comparing-int-with-size-t
0
But sizeof(a) is 4 and a=-1... Then if condition is true... Then hello should be printed...