C++ 9.3.3: Deallocatingmemory Deallocate memory for kitchenPaint using the deleteoperator. class PaintContainer { public: ~PaintContainer(); double gallonPaint;
Fantastic news! We've Found the answer you've been seeking!
Question:
C++ 9.3.3: Deallocatingmemory
Deallocate memory for kitchenPaint using the deleteoperator.
class PaintContainer {
public:
~PaintContainer();
double gallonPaint;
};
PaintContainer::~PaintContainer() { // Covered in section onDestructors.
cout << "PaintContainer deallocated." < return;
}
int main() {
PaintContainer* kitchenPaint;
kitchenPaint = new PaintContainer;
kitchenPaint->gallonPaint = 26.3;
/* Your solution goes here */
return 0;
}
Related Book For
Building Java Programs A Back To Basics Approach
ISBN: 9780135471944
5th Edition
Authors: Stuart Reges, Marty Stepp
Posted Date: