3.
is equivalent to 3.0
, it’s a double.
f
following a number literal makes it a float.
More Related Contents:
- What is this weird colon-member (” : “) syntax in the constructor?
- Why is list initialization (using curly braces) better than the alternatives?
- Is const_cast safe?
- What is the difference between static_cast and C style casting?
- Is it safe to delete a void pointer?
- C++ cast syntax styles
- What is the difference between these (bCondition == NULL) and (NULL==bCondition)?
- int a[] = {1,2,}; Why is a trailing comma in an initializer-list allowed?
- What does it mean when a numeric constant in C/C++ is prefixed with a 0?
- How do I avoid implicit conversions on non-constructing functions?
- How do you create a static class in C++?
- C++ convert from 1 char to string?
- Concatenate two string literals
- Function pointers casting in C++
- c++ array assignment of multiple values
- Is it possible to avoid repeating the class name in the implementation file?
- Why is NULL undeclared?
- Can I cast a derived class to a private base class, using C-style cast?
- Is there any difference between “T” and “const T” in template parameter?
- Is reinterpret_cast type punning actually undefined behavior?
- What does “for(;;)” mean?
- Is it OK to use C-style cast for built-in types?
- Understanding gsl::narrow implementation
- passing object by reference in C++
- Why isn’t “0f” treated as a floating point literal in C++?
- C++ strings: [] vs. *
- Should I use a C++ reinterpret_cast over a C-style cast?
- Why Doesn’t reinterpret_cast Force copy_n for Casts between Same-Sized Types?
- How to cast simple pointer to a multidimensional-array of fixed size?
- How can I extend a lexical cast to support enumerated types?