What does the letter near the digit constant mean? Just for example:
int number = 0;
float decimal = 2.5f;
number = decimal;
What’s difference betweet 2.5f and f2.5 ? I have already looked in manuals, but I really cant understand it. Explaine it me please in a simple format.
Purely as additional information (not really a direct answer to the question) I’d note that to specify the type of a character or string literal, you use a prefix (e.g., L”wide string”), whereas with a numeric literal you use a suffix (e.g., 2L or 3.5f).
C++0x adds quite a few more of both prefixes and suffixes to specify more data types (e.g., there are currently only narrow and wide string literals, but C++0x will have narrow, wide, Unicode, raw, and probably at least a couple more I can’t think of at the moment). It also adds user-defined literals that let you define your own suffixes, so something like
150kmcould be used to create adistanceobject, or"127.0.0.1"ipto create anIP_addressobject.