makePoint Factory and the Caller Deletes
easyQuestion 694The Point struct (an int x and an int y) is already written. Finish makePoint so it allocates exactly ONE Point on the heap, stores its two parameters in the x and y members, and returns that pointer. Then, in main, release each Point after it has been printed.
Both cout lines are already written. Print exactly the output shown in Expected Output.
Free the memory you allocate before the program ends — this question checks for memory leaks.
Expected output
Point: (3, 4) Point: (-2, 9)
= newline. The output ends with a newline, so print one after the last line.
Hints4 available
Sign in to use hintsTopics
Pointers
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.