Question: For the following C + + code, which statement is true? int a [ ] = { 1 , 2 } int * b =

For the following C++ code, which statement is true?
int a[]={1,2}
int*b=a;
delete []a;
The code fragment does not have a memory leak.
The assignment b=a is incorrect.
The code fragment is syntactically correct.
The statement delete [] a is incorrect since it was not created dynamically via new.
 For the following C++ code, which statement is true? int a[]={1,2}

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!