-
Notifications
You must be signed in to change notification settings - Fork 1
/
example
51 lines (50 loc) · 895 Bytes
/
example
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
#include <iostream>
using namespace std;
#include <string>
#include <vector>
class myfirstepalclass {
private:
int privatevar1 = 0;
public:
string var1 = "hallo";
};
//example comment
void test_func ( int var1 string var2 ) {
cout << "hellooo" << endl;
}
int main() {
int scur = 5;
int i = 40;
for (int i = 0; i < 20; i++) {
if (i % 2 == 0) {
scur = scur + 1;
cout << scur << endl;
try{
cout << scur << endl;
} catch (exception lulzerror) {
cout << "nope" << endl;
}
}
}
myfirstepalclass scurclass = myfirstepalclass();
scurclass.var1 = "lol";
cout << scurclass.var1 << endl;
string *ex_ptr = &scurclass.var1;
cout << *ex_ptr << endl;
int &ex_ref = scur;
cout << ex_ref << endl;
switch (scur) {
case 15:
cout << "sucess" << endl;
break;
case 1:
cout << "noooo" << endl;
break;
default:
cout << "Switch case error" << endl;
}
cout << scur << endl;
/* a neatly block comment
*/
return 0;
}