class Stack
{
private:
int tos;
const int max = 10;//here it gives an error
int a[max];
public:
void push(int adddata);
void pop();
void printlist();
};
error: invalid use of non-static data member 'max'
whats wrong in the code, and please help me with proper correction. Thankyou