Student with set
main.cpp
Go to the documentation of this file.
1 // Klasse Student:
2 // Output-Operator (friend); Mehrere Studien
3 #include "student.h"
4 #include <iostream>
5 
6 using namespace std;
7 
8 int main()
9 {
10  cout << "Hello world!" << endl;
11 
12  Student gg("Tyson", "8956256215", 421); // Parmeterkonstruktor
13 
14  cout << gg.Getname() <<endl;
15  {
16  const Student pp(gg); // Copy-Konstruktor
17  cout << pp.Getname() <<endl;
18 
19 // cout << pp._name << endl;
20  } // impliziter Destruktoraufruf fuer pp
21 
22 
23 
24  cout << gg.Getmatr_nr();
25  cout << "\n#######################\n";
26 
27  cout << "test 1: " << gg << endl;
28 
29  cout << "set new values for name and skz: ";
30  cin >> gg;
31  cout << "test 2: " << gg << endl;
32 
33  gg.Add_SKZ(112);
34  cout << "test 3: " << gg << endl;
35  gg.Del_SKZ(666);
36  gg.Add_SKZ(112); // should not add 112 to the vector again
37 
38  cout << "test 4: " << gg << endl;
39 
40  gg.Del_SKZ(421);
41  gg.Del_SKZ(112);
42  cout << "test 5: " << gg << endl;
43 
44 
45  return 0;
46 }
void Del_SKZ(const int skz)
Definition: student.cpp:37
std::string Getname() const
Definition: student.h:48
std::string Getmatr_nr() const
Definition: student.h:62
void Add_SKZ(const int skz)
Definition: student.cpp:32
int main()
Definition: main.cpp:8