forked from grantrostig/cpp_by_example
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathline.cpp
More file actions
22 lines (18 loc) · 445 Bytes
/
line.cpp
File metadata and controls
22 lines (18 loc) · 445 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <iostream>
#include "line.h"
mylib::line::line() {
point1 = new point(12, 10);
point2 = new point(12, 50);
}
mylib::line::~line() {
delete point1;
delete point2;
}
mylib::line::line(point* p1, point* p2) {
point1 = p1;
point2 = p2;
}
void mylib::line::draw_line() {
std::cout << "Drawing Line from "<< "(" << point1->x << ',' << point1->y<<")" <<
" to " << "(" << point2->x << ',' << point2->y << ")""\n";
}