-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdrafts.cpp
85 lines (57 loc) · 1.18 KB
/
drafts.cpp
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#include <iostream> //For cout
#include <cstring> //For the string functions
#include <stdio.h>
#include <iomanip>
#define PRINT_TOKEN(token) printf(#token " is %d", token)
using namespace std;
//Do not run this
class TestA
{
public:
int val = 0;
void test ();
};
void TestA::test()
{
val = 15;
cout << val << "testA";
}
class TestB : public TestA
{
public:
void test ();
};
void TestB::test()
{
val = 45;
cout << val << "testB";
}
int testFunc(int x, int y);
int testFunc(int x, int y)
{
int z;
if (x > y) z = x++;
else return z = y++;
}
int main()
{
TestA * a = new TestB;
TestB * b = new TestB;
b->test();
a->test();
int x = 11; int y = 3;
char str[15] = "asdasd" "sedsedse";
cout<<setfill('-')<<setw(15)<<left<<"wer"<<left<<"zxc"<<endl;
cout << setbase(16) << 466 << " " << 64 << endl;
cout << "Modulo operations" << endl;
cout << (x - ((x / y) * y)) << endl;
cout << x % y << endl;
PRINT_TOKEN(x+y);
int m = 5 + \
4;
int z = testFunc(x++, y++);
cout << "\n" << z;
cout << "\n" << y;
cout << "\n" << m;
return 0;
}