What do F and D mean at the end of numeric literals?

Means that these numbers are doubles and floats, respectively. Assume you have

void foo(int x);
void foo(float x);
void foo(double x);

and then you call

foo(5)

the compiler might be stumped. That’s why you can say 55f, or 5.0 to specify the type.

Leave a Comment