-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathoop_tut01.cpp
More file actions
44 lines (35 loc) · 813 Bytes
/
oop_tut01.cpp
File metadata and controls
44 lines (35 loc) · 813 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
42
43
44
#include <iostream>
using namespace std;
class students
{
private:
int a, b, c;
public:
int d, e;
void setData(int a, int b, int c);
void getData(int d, int e);
};
void students::setData(int a1, int b1, int c1) // --> change a to a1 due to 33=a1 & a1=a the a which is
// private */
{
a = a1;
b = b1;
c = c1;
}
void students ::getData(int d, int e)
{
cout << "The value of a is :" << a << endl;
cout << "The value of b is :" << b << endl;
cout << "The value of c is :" << c << endl;
cout << "The value of d is :" << d << endl;
cout << "The value of e is :" << e << endl;
}
int main()
{
students ali;
// ali.d = 31;
// ali.e = 85;
ali.setData(33, 3, 5);
ali.getData(31, 85);
return 0;
}