SIGN IN SIGN UP
// variables inside a class
2019-07-14 20:39:17 +08:00
#include <iostream>
using namespace std;
2019-07-14 20:39:17 +08:00
class Apple {
public:
static int i;
2019-07-14 20:39:17 +08:00
Apple(){
// Do nothing
};
};
2019-07-14 20:39:17 +08:00
int main() {
Apple obj1;
Apple obj2;
obj1.i = 2;
obj2.i = 3;
2019-07-14 20:39:17 +08:00
// prints value of i
cout << obj1.i << " " << obj2.i;
}