How to write Numbers With Commas?

Viewed 65

Sometimes in C++ I want to use large number like 1000000 and it's confusing. How can I use commas (if that is possible)?

For example I want this to work

int x = 1,000,000;
1 Answers

You an use the digit separator since c++14

int x = 1'000'000 

Does this work for you?

Related