What is the significance of 0.0f when initializing (in C)?

前端 未结 7 503
被撕碎了的回忆
被撕碎了的回忆 2020-11-29 04:30

I\'ve seen code where people initialize float variables like this:

float num = 0.0f;

Is there a significant difference between this and jus

相关标签:
7条回答
  • 2020-11-29 05:14

    'f' indicates that you want a float :

    0 is an int

    0f is a float

    0.0 is a double

    0.0f is a float

    0 讨论(0)
提交回复
热议问题