31 lines
505 B
C++
31 lines
505 B
C++
#include <iostream>
|
|
#include "CPoint.h"
|
|
|
|
int main() {
|
|
Point p1(3,4);
|
|
CPoint c1;
|
|
|
|
//p1=c1; // OK
|
|
//c1=p1; // ERROR
|
|
p1.print();
|
|
c1.print();
|
|
|
|
Point* p_p1 = &p1;
|
|
Point* p_c1 = &c1;
|
|
//p_p1->print();
|
|
//p_c1->print();
|
|
/*
|
|
Point* arrPoints[2];
|
|
arrPoints[0]=&p1;
|
|
arrPoints[1]=&c1;
|
|
std::cout << "---------------" << std::endl;
|
|
for (int i=0; i < 2; i++) {
|
|
arrPoints[i]->print();
|
|
}
|
|
*/
|
|
delete p_p1;
|
|
delete p_c1;
|
|
|
|
return 0;
|
|
}
|