Shall we use 'free' to free memory assigned by new, What are
the further consequences??
Answer Posted / nishikant sahu
Yes you can but not recommend, b'c some time when you class
hold the heap memory it can't be free by "Free" b'c of no
constructor call happening via "Free" and you get the memory
leak. so use New/ delete or malloc/free pair.
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
What does ctime() do?
What is meant by forward referencing and when should it be used?
What header file is needed for exit(); a) stdlib.h b) conio.h c) dos.h
In c++, what is the difference between method overloading and method overriding?
If a round rectangle has straight edges and rounded corners, your roundrect class inherits both from rectangle and from circle, and they in turn both inherit from shape, how many shapes are created when you create a roundrect?
What is java and c++?
Search for: what is pair in c++?
What are the classes in c++?
Describe about storage allocation and scope of global, extern, static, local and register variables?
. If employee B is the boss of A and C is the boss of B and D is the boss of C and E is the boss of D. Then write a program using the Database such that if an employee name is Asked to Display it also display his bosses with his name. For eg. If C is displayed it should also display D and E with C?
What is the difference between delegation and implemented-in-terms-of?
What is rtti in c++?
What is the c++ programming language used for?
What is istream c++?
Explain the concept of memory leak?