Question: (a) (5 points) Complete the following (silly) function implementation so that no memory is leaked. void facebook() { int linkedin 7; int hi5 &linkedin;

(a) (5 points) Complete the following (silly) function implementation so that no 

(a) (5 points) Complete the following (silly) function implementation so that no memory is leaked. void facebook() { int linkedin 7; int hi5 &linkedin; intorkut= new int [4]; orkut; int friendster int bebo [0] = &friendster [3]; bebo [1] new int; bebo [2] bebo [0]; bebo= new int [3]; // add code to free each piece of dynamically // allocated memory exactly once } (b) (3 points) Write the line of C++ code that declares a variable named album whose type is a vector of dynamic arrays of BMPs. (c) (2 points) Briefly describe the two instances when the destructor is called.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!