This question already has an answer here:
Imagine I have the code:
vector<int> temp = vector<int>(1 000 000 000);
The above will not compile as the compiler will complain about the spaces. Is it possible to indicate to C++ to ommit those spaces when compiling, or otherwise make the number easier to read?
Try digit separator:
int i = 1'000'000'000;
This feature is introduced since C++14. It uses single quote (
') as digit separator.
- 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)