- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
Latest commit
26 lines (17 loc) · 353 Bytes
/
Copy pathmain.cpp
File metadata and controls
26 lines (17 loc) · 353 Bytes
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
#include<iostream>
usingnamespacestd;
classGreeter {
public:
Greeter() {name = "Unnamed";}
Greeter(string n) {name = n;}
voidhello(string who = "World") {
cout << "Hello " << who << ". My name is " << name << endl;
}
private:
string name;
};
intmain () {
Greeter my_greeter("Aggelos");
my_greeter.hello();
return0;
}