Why isn\'t 0f treated as a floating point literal in C++?
#include
using namespace std;
int main(){
cout << 0f <&l
This isn't necessarily the only reason, but an l or L suffix can be applied to an integer literal or to a floating-point literal. 42L is of type long int; 42.0L is of type long double.
A numeric literal with an L suffix must be disambiguated to determine whether it's integer or floating-point. Allowing an F suffix by itself to determine the type of a literal would be inconsistent and potentially confusing. It would also make it more difficult to add new suffixes in future versions of the language.