Can the auto keyword be used as a storage class specifier in C++11?
Is the following code legal in C++11?
int main() {
auto int x;
}
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.
No the code is ill-formed in C++11.
autoin C++11 would be used to deduce the type of a variable from its initializer and it can’t be used as a storage class specifier.Correct Usage