Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <iostream>
- #include <string>
- #include <set>
- #include <algorithm>
- using namespace std;
- class A
- {
- int x;
- static int * ptr;
- public:
- void Inicjalizuj();
- void Wyczysc();
- void Pokaz();
- };
- int * A::ptr = NULL;
- void A::Inicjalizuj()
- {
- ptr = new int;
- cin >> *ptr;
- }
- void A::Wyczysc()
- {
- delete ptr;
- }
- void A::Pokaz()
- {
- cout << *ptr << endl << endl;
- }
- int main()
- {
- A obj;
- obj.Inicjalizuj();
- obj.Pokaz();
- obj.Wyczysc();
- obj.Pokaz();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement