int main()
{
typedef struct a
{
static int w;
char *p;
} a;
}
on compiling it gives error:expected specifier-qualifier-list before 'static'
could u please tell me what this error means and how to remove it?
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.
Local classes cannot have static data members in C++.
To quote the standard (Paragraph 9.8.4)
In the unlikely case that you don’t know, a local class is a class, struct, or union defined in function scope.
9.8.1