In the following code, lines 7 and 8 both create an anonymous object and print the area of the circle. Why is line 8 bad?
1 #include2 #include "Circle.h" 3 using namespace std;45 int main()6 {7 cout << Circle(5).getArea() << end⌉;8 cout << (new Circle(5))->getArea() << end⌉;910 return 0 ;11 }
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.