Question: Complete the CityNode class destructor. The destructor prints Deallocating CityNode ( , followed by the value of name, a space, and the value of
Complete the CityNode class destructor. The destructor prints "Deallocating CityNode followed by the value of name, a space, and the value of population, and then End with a newline.
Ex: If the input is Bow then the output is:
Deallocating CityNode Bow
#include
using namespace std;
class CityNode
public:
CityNodestring nameValue, int populationValue
name nameValue;
population populationValue;
Your code goes here
string name;
int population;
CityNode next;
;
int main
CityNode myCity;
string inputString;
int inputValue;
cin inputString;
cin inputValue;
myCity new CityNodeinputString inputValue;
delete myCity;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
