Question: Complete the WebsiteNode class destructor. The destructor prints Deallocating WebsiteNode (, followed by the value of traffic, a space, and the value of links, and
Complete the WebsiteNode class destructor. The destructor prints "Deallocating WebsiteNode (", followed by the value of traffic, a space, and the value of links, and then ")". End with a newline.
Ex: If the input is 1855 43, then the output is:
#include
class WebsiteNode { public: WebsiteNode(int trafficValue, int linksValue) { traffic = trafficValue; links = linksValue; } /* Your code goes here */ int traffic; int links; WebsiteNode* next; };
int main() { WebsiteNode* myWebsite; int inputValue1; int inputValue2;
cin >> inputValue1; cin >> inputValue2;
myWebsite = new WebsiteNode(inputValue1, inputValue2); delete myWebsite; return 0; }
c++ and please please make it correct
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
