CSC112 Spring 2016 Examples
1#include <iostream> 2#include "point.h" 3 4using namespace std; 5 6int main() 7{ 8 Point *p1 = new Point(2, 4); 9 Point *p2 = new Point(3, 7); 10 Point *p3 = new Point; 11 12 *p3 = *p1 + *p2; 13 14 //print them out! 15 cout << *p1 << " + " << *p2 << " = " << *p3 << endl; 16 17 return 0; 18} 19 20