Question: (C++) Identify any problem with the following code that uses a dynamic array (assume magazineSize has been properly set). You may select one or more
(C++) Identify any problem with the following code that uses a dynamic array (assume magazineSize has been properly set). You may select one or more answers.
string* articles = new string[magazineSize]; string* textP; for (textP = articles; textP < articles + magazineSize; textP++) cout << *textP << endl; delete[] textP; textP = NULL;
Group of answer choices
a. Leaves dangling pointer (pointer retains address after no longer used)
b. Creates memory leak (array not properly deallocated)
c. Dereferences a NULL pointer
d. Accesses memory outside of array
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
