-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCreateI.cpp
More file actions
40 lines (36 loc) · 710 Bytes
/
CreateI.cpp
File metadata and controls
40 lines (36 loc) · 710 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
#include <iostream>
using namespace std;
class ThreeD
{
private:
int x, y, z;
public:
ThreeD(int a, int b, int c)
{
x = a;
y = b;
z = c;
}
// ~ThreeD() {}
friend istream &operator>>(istream &stream, ThreeD &obj)
{
cout << " Input through space x y z:" ;
stream >> obj.x >> obj.y >> obj.z;
return stream;
}
friend ostream &operator<<(ostream &stream, ThreeD obj)
{
stream << obj.x << ",";
stream << obj.y << ",";
stream << obj.z << "\n";
return stream;
}
};
int main(int argc, char const *argv[])
{
ThreeD a(1, 2, 3);
cout << a;
cin >> a;
cout << a;
return 0;
}