-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathmain.cpp
More file actions
executable file
·44 lines (36 loc) · 1.49 KB
/
main.cpp
File metadata and controls
executable file
·44 lines (36 loc) · 1.49 KB
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
#include "student.hpp"
#include "studentpimpl.hpp"
#include <iostream>
#include <string>
int main() {
std::cout << "============Student============" << std::endl;
Student student(34, "Behnam");
std::cout << student.getID() << std::endl;
std::cout << student.getName() << std::endl;
student.setID(12);
student.setName("Bamboo");
std::cout << student.getID() << std::endl;
std::cout << student.getName() << std::endl;
std::cout << "============Studentpimpl============" << std::endl;
Studentpimpl studentpimpl(34, "Behnam");
std::cout << studentpimpl.getID() << std::endl;
std::cout << studentpimpl.getName() << std::endl;
studentpimpl.setID(12);
studentpimpl.setName("Bamboo");
std::cout << studentpimpl.getID() << std::endl;
std::cout << studentpimpl.getName() << std::endl;
std::cout << "============Studentpimpl Copy Constructor============"
<< std::endl;
Studentpimpl studentpimpl1 = studentpimpl;
std::cout << studentpimpl.getID() << std::endl;
std::cout << studentpimpl.getName() << std::endl;
std::cout << studentpimpl1.getID() << std::endl;
std::cout << studentpimpl1.getName() << std::endl;
std::cout << "============Studentpimpl Assignment============" << std::endl;
Studentpimpl studentpimpl2(35, "Mumbo");
std::cout << studentpimpl2.getID() << std::endl;
std::cout << studentpimpl2.getName() << std::endl;
studentpimpl2 = studentpimpl;
std::cout << studentpimpl2.getID() << std::endl;
std::cout << studentpimpl2.getName() << std::endl;
}