Question: Rewrite the C++ code given below so that to dynamically allocate and de-allocate memory for the array variable spal) All expressions using the variable gpa

 Rewrite the C++ code given below so that to dynamically allocate

Rewrite the C++ code given below so that to dynamically allocate and de-allocate memory for the array variable spal) All expressions using the variable gpa ) should be rewritten using pointers. include toate using namespace atdi detin int main() float pa SIZE) for(int 1-SIZE: 1503 1 cout > gpall) for int 1-SIZE: 150 ;-) cout using namespace std; #define SIZE 3 int main() { for(int 1-SIZE: 18;) cout > > for(int i=SIZE; 1>0; i--) { cout return : Igpa) int gpa = new float[SIZE: gpati): delete "gpallapati (gpa+l). (Spa+i): float new topa - float[SIZE)delete Ogpas delete lapa: delete spall float gpa = new float[SIZE]: float "gpa = new float(SIZE)

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 Databases Questions!