Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //ы
- #include <iostream>
- using namespace std;
- struct A
- {
- static int n;
- void setN(int num){ n = num; }
- void showN(){ cout << n << endl; }
- };
- // чтобы это делать НЕ тут, а динамически в main() !!
- int A::n;
- void main()
- {
- A a;
- a.showN();
- a.setN(22);
- a.showN();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement