+ 1
You had a few issues, but I've corrected your code for you and it complies now. 1. When you copy/pasted the code into Code Playground, it replaced your whitespaces with periods, which was causing a problem with compiling the code. 2. You didn't have a main loop/function, so there was no entry point into your program. 3. At the top you were using your structs before you even created them, so I removed that from the top and placed it at the bottom inside of the main loop instead. Posted a link to the code (if you need to copy/paste) and provided the code before for your viewing. Hope it helps! Good luck. https://code.sololearn.com/cwA3fLO6W3Ph/#cpp #include <iostream> struct Size{ int width, height; Size () {} Size (int width, int height) { this->width = width; this->height = height; } }; struct Point { int top, left; Point () {} Point (int top, int left) { this->top = top; this->left = left; } }; struct Rectangle { Size size; Point point; Rectangle (Size size1, Point point) { this->size = size1; this->point = point; } }; int main() { Size size(10, 10); Point point(5, 5); Rectangle rect(size, point); std::cout << "Completed."; return 0; }
29th Mar 2018, 5:12 PM
Fata1 Err0r
Fata1 Err0r - avatar