why sizeof(13.33) is 8 bytes?

后端 未结 5 664
醉酒成梦
醉酒成梦 2020-12-06 18:38

When I give sizeof(a), where a=13.33, a float variable, the size is 4 bytes. But if i give sizeof(13.33) directly, the size is 8 bytes

5条回答
  •  天涯浪人
    2020-12-06 18:59

    The 13.33 literal is being treated as 'double', not 'float'.

    Try 13.33f instead.

提交回复
热议问题