Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning C# 2005 Databases

Authors: Karli Watson

1st Edition

0470044063, 978-0470044063

More Books

Students also viewed these Databases questions

Question

5. Develop the succession planning review.

Answered: 1 week ago