Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Student {
- private:
- string name, surname;
- int age;
- public:
- Student() {
- name = "";
- surname = "";
- age = 0;
- cout << "empty" << endl;
- }
- Student(string _name, string _surname, int _age) {
- name = _name;
- surname = _surname;
- age = _age;
- cout << "parameterized" << endl;
- }
- Student(const Student &object) {
- name = object.name;
- surname = object.surname;
- age = object.age;
- cout << "copy" << endl;
- }
- };
- int main() {
- Student s;
- Student s1("josif", "tepegjozov", 100);
- Student s2 = s1;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement