Hi all,
i'm new to c and while compiling small snippet of code on gcc its showing "expected specifier-qualifier-list before private" error.I'm not able to find out whats the reason causing this problem.if anyone's suggestions to solve this would be a great help.
here is my code,
Code:
typedef struct
{
private: // in this line i'm getting error as expected specifier-qualifier-list
//before private
int choice;
public:
void (*fun_ptr[2])();
int add();
int pause();
void checkState(int nChoice)
{
if(nChoice == CONTINUE)
{
fun_ptr[0] = add ;
}
else if (nChoice == STOP)
{
fun_ptr[1] = pause ;
}
else
{
printf("u entered a wrong choice...exiting... ");
exit(1);
}
}
} exeState;
int main()
{
//exeState s;
printf("enter ur choice 1 to start the process of addtion...2 for pausing...");
//scanf("%d", &s.choice);
//s.checkState(s.choice);
getchar();
return 0;
}