blob: f59286e7f537dad5fc0b88572022a0c6406e27ce (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#include <iostream>
#include "person.hh"
int main()
{
Person my_person("Gordon Freeman", 47);
const Person& my_person2 = my_person;
std::cout << "name: " << my_person2.get_name()
<< ", years: " << my_person2.get_age() << std::endl;
std::string name = "Alyx Vance";
my_person.set_name(name);
my_person.set_age(24);
std::cout << "name: " << my_person2.get_name()
<< ", years: " << my_person2.get_age() << std::endl;
}
|