Mooophy / Cpp-Primer

C++ Primer 5 answers
Creative Commons Zero v1.0 Universal
8.05k stars 3k forks source link

ex2.5 notation vs type? #817

Open lthiet opened 2 years ago

lthiet commented 2 years ago

Hi,

In the answers, you suggest that 012 is an octal type and 0xC is a hexadecimal

I was wondering if you have considered that octal and hexadecimal are just notations instead of types? I would rather say that these are unsigned int.

What do you think?

pezy commented 2 years ago

https://en.cppreference.com/w/cpp/language/integer_literal