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 is size_type?
What is lambda expression c++?
What do you mean by funtion prototype?
Differentiate between realloc() and free().
When does a name clash occur in c++?
What is #include iomanip?
an operation between an integer and real always yeilds a) integer result b) real result c) float result
What do you mean by const correctness?
Do inline functions improve performance?
Why are pointers not used in c++?
What is the main use of c++?
Is recursion allowed in inline functions?
Which command properly allocates memory a) char *a=new char[20]; b) char a=new char[20]; c) char a=new char(20.0);
What is the maximum value of a unsigned char a) 255 b) 256 c) 128
If you want to share several functions or variables in several files maitaining the consistency how would you share it?