Try digit separator:
int i = 1'000'000'000;
This feature is introduced since C++14. It uses single quote ('
) as digit separator.
Also see:
- Why was the space character not chosen for C++14 digit separators?
- Generalizing Overloading for C++2000 (April’s joke by the father of C++ himself)
More Related Contents:
- What is special about numbers starting with zero?
- What does it mean when a numeric constant in C/C++ is prefixed with a 0?
- Leading zeros of a binary number doesn’t get printed
- Why is list initialization (using curly braces) better than the alternatives?
- Multicharacter literal in C and C++
- Const before or const after?
- When is the “typename” keyword necessary? [duplicate]
- Print leading zeros with C++ output operator?
- What is the difference between these (bCondition == NULL) and (NULL==bCondition)?
- Why do people use __ (double underscore) so much in C++
- What are the advantages of list initialization (using curly braces)?
- int a[] = {1,2,}; Why is a trailing comma in an initializer-list allowed?
- Can the template parameters of a constructor be explicitly specified?
- Why is using the function name as a function pointer equivalent to applying the address-of operator to the function name?
- How do you create a static class in C++?
- Concatenate two string literals
- c++ array assignment of multiple values
- What’s this C++ syntax that puts a brace-surrounded block where an expression is expected?
- Is it possible to avoid repeating the class name in the implementation file?
- How typedef works for function pointers
- Is there any difference between “T” and “const T” in template parameter?
- How to break out of a loop from inside a switch?
- Why does this call the default constructor?
- What’s the syntax for declaring an array of function pointers without using a separate typedef?
- Why does cin command leaves a ‘\n’ in the buffer?
- How do you set the cout locale to insert commas as thousands separators?
- Purpose of a “.f” appended to a number?
- passing object by reference in C++
- What does ‘**’ mean in C?
- Why isn’t “0f” treated as a floating point literal in C++?