#if 0 #include using namespace std; struct point { double x; double y; }; // Returns midpoint of two given points point calcMidpoint (point p1, point p2); // read point from cin point readPoint(); int main() { point p1, p2, p3; p1 = readPoint(); p2 = readPoint(); p3 = calcMidpoint(p1, p2); cout << "The midpoint was " << p3.x << " " << p3.y << endl; return 0; } point calcMidpoint (point p1, point p2) { point newpt; newpt.x = (p1.x + p2.x) / 2; newpt.y = (p1.y + p2.y) / 2; return newpt; } // read point from cin point readPoint() { point pt; cout << "Please enter a point like 4.3 5.4: "; //cin >> p1; ERROR! cin >> pt.x; cin >> pt.y; return pt; } #endif