difference between "0.0" and "0"?

for example,

int p = 0;
float q = 0.0; <------ why not 0, instead of 0.0?

what difference does it make?


0 is an integer literal whereas 0.0 is a double precision literal. Its a convention to tell the compiler how to store the value in memory.
Topic archived. No new replies allowed.