In c++ when you write setprecision (12) for example, 12 is in the base of 10 but when you write it like setprecision (012) it is an octal number,why?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Because constants with leading zeros (other than leading 0x) are always octal:
C++ draft standard (n1905) §2.13.1
It has nothing at all to do with setprecision.