Changing variables in other classes Code::Blocks

I want to make a basic RPG text based games with multiple classes. but I wan to know how In one class I make a variable and in another and can call the variable.

for exmaple

class2:
int hi = 1;

class1:
class2 a;
hi = 2;
cout << hi;

2
Topic archived. No new replies allowed.