how to free the memory?

Thread Starter

summeranson

Joined Feb 12, 2009
28
What should you do to free the memory after running this code?

char *a; a = new char[20];


A. I don't know


B. delete [] a;

C. delete a[];

D. delete a;
 

Mark44

Joined Nov 26, 2007
628
What should you do to free the memory after running this code?

char *a; a = new char[20];


A. I don't know


B. delete [] a;

C. delete a[];

D. delete a;
Are you using a textbook? If so, look at the section on the various forms of delete that are associated with new.
 
Top