in some codes, i see that expressions such as:
3.14f,(for float)
2.64l(for long double)
is used. what is this typecasting method called as?
in some codes, i see that expressions such as:
3.14f,(for float)
2.64l(for long double)
is used. what is this typecasting method called as?
It is not a typecast; it is just a way of specifying that the literal is of the particular type.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
They're called a "suffix"
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
anything with a floating point is automatically a double foe the computer. here you say 3.14f, it means.. oh wait, it's not double, it is float. use it as a float!
also check out this discussion -
c tricky code