What is the difference between new/delete and malloc/free?
Answer / neelam saini
Malloc/free do not know about constructors and destructors. New and delete create and destroy objects, while malloc and free allocate and deallocate memory.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is new in c++?
In a class, there is a reference or pointer of an object of another class embedded, and the memory is either allocated or assigned to the new object created for this class. In the constructor, parameters are passed to initialize the data members and the embedded object reference to get inialized. What measures or design change should be advised for proper destruction and avioding memory leaks, getting pointers dangling for the embedded object memory allocation? Please suggest.
Why do we need templates?
What is #include c++?
What is a concrete class?
what are the decision making statements in C++? Explain if statement with an example?
What happens if an exception is throws from an, object's constructor and object's destructor?
Explain the difference between c & c++?
What's the hardest coding language?
What are the basics concepts of OOPS?
Explain one-definition rule (odr).
given unsigned int ui1=3,ui2=7; what are the outputs of a)ui1 & ui2 b)ui1 && ui2 c)ui1 | ui2 d)ui1 || ui2 i also need the justification for the answers thank you