What is the difference between:
const variable = 10;
and
const int variable = 10;
Does variable, per the standard, get interpreted as an integral type when no type is defined?
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.
const variable = 10is not valid C++, whileconst int variable = 10;is.The only time (that I can think of) that
const variable = 10would be valid is if you had a type namedvariableand you had a function with an unnamed parameter of that type, taking a default argument: