OKay... I have a newbie question.
#include <stdio.h>
class Test{
public:
Test(int x);
};
int Test::Test(int x=0){
}
int main(){
Test test(1);
printf("%d", test.x);
}
My question is how to make the x variable of the constructor public.
I have tried to add :
public:
int x = 0;
to my constructor .... but it is an another error.
I know this problem is simple, but I have been suffering with it for ... a long time