-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSoldier.cpp
45 lines (40 loc) · 1.19 KB
/
Soldier.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include<iostream>
#include"Soldier.h"
Soldier::Soldier(
const std::string SoldierFirstName,
const std::string SoldierLastName,
std::string SoldierNickName,
const int SoldierPhone,
const std::string SoldierSecret
)
:
firstName(SoldierFirstName),
lastName(SoldierLastName),
nickName(SoldierNickName),
phoneNumber(SoldierPhone),
darkestSecret(SoldierSecret)
{
//std::cout << "Soldier constructor initialized\n" << std::endl;
}
Soldier::Soldier(const Soldier& copySoldier) :
firstName(copySoldier.firstName),
lastName(copySoldier.lastName),
nickName(copySoldier.nickName),
phoneNumber(copySoldier.phoneNumber),
darkestSecret(copySoldier.darkestSecret)
{
//std::cout << "Soldier copy constructor initialized\n" << std::endl;
}
Soldier::~Soldier()
{
//std::cout << "Soldier destructor initialized\n" << std::endl;
}
std::ostream& operator<<(std::ostream& out, const Soldier& sldr)
{
out << "Soldier full name: " << sldr.getFullName() << '\n'
<< "Soldier nick name: " << sldr.getNickname() << '\n'
<< "Soldier phone number: " << sldr.getPhoneNbr() << '\n'
<< "Soldier's secret: " << sldr.getDarkestSecret() << '\n'
<< std::endl;
return out;
}