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

If you push the numbers (in order) 1, 3, and 5 onto a stack, which pops out first a) 1 b) 5 c) 3

838


Why are pointers not used in c++?

628


What do you mean by delegate? Can a user retain delegates?

528


What is the syntax for a for loop?

603


What does iomanip mean in c++?

605






Explain what are single and multiple inheritances in c++?

561


What is purpose of new operator?

599


What are the different types of polymorphism in c++?

591


Is atoi safe?

603


What do the keywords volatile and mean mutable?

608


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

564


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?

669


Can you please explain the difference between using macro and inline functions?

535


What is lvalue?

700


What are static variables?

619