forked from grantrostig/cpp_by_example
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpoint.cpp
More file actions
38 lines (31 loc) · 622 Bytes
/
point.cpp
File metadata and controls
38 lines (31 loc) · 622 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
#pragma once
#include "point.h"
#include <iostream>
mylib::point::point() {
x = 1;
y = 1;
}
mylib::point::point(int x, int y) {
this->x = x;
this->y = y;
}
int mylib::point::get_x(void) const {
return x;
}
int mylib::point::get_y(void) const {
return y;
}
/*Definition of Non-Member function*/
void mylib::print_point(const point& pref) {
std::cout << "X : " << pref.x << "\tY : " << pref.y << '\n';
}
int mylib::A::foo() {
B bobj;
std::cout << "B::data : " << bobj.data << "\n";
return 0;
}
int mylib::A::bar() {
//B bobj;
//std::cout << "B::data : " << bobj.data << "\n";
return 0;
}