What will happen if I allocate memory using "new" and free
it using "free" or allocate sing "calloc" and free it using
"delete"?

Answer Posted / roshan p.r.

Hi,

you cannot free a memory allocated with new using "free"
and in the same way callac with "delete"

because they are incompatable

Is This Answer Correct ?    0 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is c strings syntax?

679


Why is swift so fast?

717


What size is allocated to the union variable?

680


What parameter does the constructor to an ofstream object take?

703


What is the difference between delegation and implemented-in-terms-of?

627






What is an operator function? Describe the function of an operator function?

713


How important is c++?

617


What is a namespace in c++?

703


What are punctuators in c++?

762


write a porgram in c++ that reads an integer and print the biggest digit in the number

1864


Why do we use pointers in c++?

677


what are the iterator and generic algorithms.

1568


Do you know what are the new features that iso/ansi c++ has added to original c++ specifications?

642


What does extern mean in a function declaration in c++?

796


What should main() return in c and c++?

613