Is there something that we can do in C and not in C++?

Answer Posted / dangling pointer

try this one
int *x=malloc(10);
it works in c but not in c++ reason is we will have to
explicitly cast in c++ to convert a void* to another type
to work.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between interpreters and compilers?

833


Do you know what are pure virtual functions?

848


What is the return value of the insertion operator?

825


What is encapsulation in c++ with example?

750


How long will it take to learn programming?

782


Write a program in C++ for Fibonacci series

857


What is srand c++?

808


What does the following do: for(;;) ; a) Illegal b) Loops forever c) Ignored by compiler...not illegal

918


What is ifstream c++?

788


Why is c++ so fast?

723


Write about the role of c++ in the tradeoff of safety vs. Usability?

791


What is object in c++ wikipedia?

748


How do I download c++?

730


How many standards of c++ are there?

833


Differentiate between an external iterator and an internal iterator? What is the advantage of an external iterator.

791