Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- #include <stdexcept>
- #include <iostream>
- using namespace std;
- class Test
- {
- public:
- Test()
- {
- cout << "wywolujemy konstruktor bezargumentowy" << endl;
- }
- Test(const Test& test)
- {
- cout << "wywolujemy konstruktor kopiujacy" << endl;
- }
- ~Test()
- {
- cout << "wywolujemy destruktor" << endl;
- }
- void ref_metoda(Test& test)
- {
- cout << "argument przekawywany przez referencje" << endl;
- }
- void wart_metoda(Test test)
- {
- cout << "argument przekawywany przez wartosc" << endl;
- }
- void wsk_metoda(Test* test)
- {
- cout << "argument przekawywany przez wskaznik" << endl;
- }
- };
- int main()
- {
- Test arg, *ptr;
- //arg.wart_metoda(arg);
- arg.wsk_metoda(&arg);
- //arg.ref_metoda(arg);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment