-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.cpp
More file actions
41 lines (31 loc) · 640 Bytes
/
main.cpp
File metadata and controls
41 lines (31 loc) · 640 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// include the header file to main.cpp
#include "main.h"
/* calling the first helloworld in a void func */
void firstcallbackfunction()
{
myFirstClass obj;
obj.myfirsthelloworld();
}
/* calling the second helloworld in a void func */
void secondcallbackfunction()
{
myFirstClass obj;
obj.mysecondhelloworld();
}
void banner()
{
std::cout << "helloworld\n";
}
int main()
{
banner();
int x;
std::cout << "enter a int to print two type of helloworld: ";
std::cin >> x;
if (x == 100)
{
firstcallbackfunction();
} else {
secondcallbackfunction();
}
}