in C Plus Plus by
Q:
Digit separators C++ 14 Feature

▼ Show 1 Answer

0 votes
by

In C++14, the single-quote character may be used arbitrarily as a digit separator in numeric literals, both integer literals and floating point literals.This can make it easier for human readers to parse large numbers through subitizing.

auto integer_literal = 1'000'000;

auto floating_point_literal = 0.000'015'3;

auto binary_literal = 0b0100'1100'0110;

auto silly_example = 1'0'0'000'00;

Learn More with Madanswer

Related questions

+1 vote
+1 vote
asked Jan 4, 2020 in C Plus Plus by AdilsonLima
...