Difference between delete and delete[]?
Answer Posted / vikas
If p is pointer to an array and is allocated memory on
heap, then delete p would call the destructor of the first
element but will free up the whole block. More info at:
http://www.cppquestions.com/viewtopic.php?f=27&t=13
Is This Answer Correct ? | 14 Yes | 5 No |
Post New Answer View All Answers
How one would use switch in a program?
Does there exist any way to make the command line arguments available to other functions without passing them as arguments to the function?
Explain terminate() and unexpected() function?
What are multiple inheritances (virtual inheritance)?
Does c++ have a hash table?
What does the nocreate and noreplace flag ensure when they are used for opening a file?
Is c# written in c++?
What are exceptions c++?
What is the purpose of templates in c++?
What is a stack c++?
What is the difference between an array and a list?
What is cin clear () in c++?
What is a forward referencing and when should it be used?
write asingle linked list which read from two list & the do the following 1 sort the prime & nonprime num (prime should be less tn nonprime) 2 each node has a prime num followd by nonprime 3 add a new node into its sutable plce 4 erase the most three duplicated non prime num 5 find the least duplicated prime num
What is the difference between global variables and static varables?