double to float conversion error

 
float w = 0.80;


this gives an error: warning C4305: 'initializing' : truncation from 'double' to 'float'.
please tell me about this.
That's not an error, that's a warning. Warnings don't stop compilation. In order for the literal value to be of type float you need to append a "f" at the end of it.

float w = 0.80f;
Topic archived. No new replies allowed.