Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Задание 2
- //Найти и объяснить сделанные ошибки
- //Что выведется, если после исправления ошибок(тупо удалить ошибочные конструкции из f) вызвать ф-ию f
- class A
- {
- int a;
- A() {this->a=100; cout <<1;}
- public:
- A(int a=0) {this->a=a; cout<<2;}
- A(A& b) {a=b.a; cout <<3;}
- ~A() {cout <<4;}
- void operator = (A& b) {a=b.a; cout << 5;}
- }
- void f()
- {
- A x(1);
- A y;
- A z = A(2);
- }
Add Comment
Please, Sign In to add comment