-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunc_pointer_revise.cpp
More file actions
71 lines (44 loc) · 1.23 KB
/
func_pointer_revise.cpp
File metadata and controls
71 lines (44 loc) · 1.23 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// struct item
// {
// int data;
// struct item* next;
// };
// int f(struct item *p)
// {
// return((p = = NULL)||(p ―> next = = NULL) ||
// ((p ―>data <= p ―>next―> data)&& f(p―> next)));
// }
// #include <iostream>
// #include <string>
// class Login {
// int tries = 5;
// const char* PASSWORD = "changeme";
// public:
// void SetPassword () {
// std::cout << "Enter the password: ";
// std::string inputPassword;
// do {
// std::cin >> inputPassword;
// if (inputPassword == PASSWORD) {
// std::cout << "Password Acceted"
// << std::endl;
// exit(0); //if password matches before 5 tries program will exit successfully.
// }
// } while (--tries);
// std::cout << "Access denied. Please contact IT services to reset your password"
// << std::endl; //if password doesn't match then it will come here and print this
// }
// };
#include <iostream>
int Add (int a, int b) {
return a + b;
}
int Sum (int a, int b) {
return a - b;
}
int (*something[])(int a, int b) = {Add, Sum};
int main () {
// Login test;
// test.SetPassword();
std::cout << something[0](10, 5);
}