Difference between delete and delete[]?
Answer Posted / sunita shukla
Delete p deallocate memory pointed to by p and delete []p deallocate array. But delete p will delete only p[0]. Other array's Size-1 entries will not be deleted and this memory will leak.
Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Differentiate between the message and method in c++?
Evaluate as true or false: !(1 &&0 || !1) a) True b) False c) Invalid statement
What is a c++ vector?
Can the operator == be overloaded for comparing two arrays consisting of characters by using string comparison?
How can you quickly find the number of elements stored in a static array?
Difference between a copy constructor and an assignment operator.
Differentiate between the manipulator and setf( ) function?
What is oops in c++?
Which one is better- macro or function?
Discuss the effects occur, after an exception thrown by a member function is unspecified by an exception specification?
How did c++ get its name?
Is ca high or low level language?
What is friend class in c++ with example?
What are the two types of comments, and how do they differ?
What is the cout in c++?