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
Explain what are the sizes and ranges of the basic c++ data types?
How a pointer differs from a reference?
What is the purpose of extern storage specifier?
What are put and get pointers?
What does getch() do according to the ANSI C++ standard a) Reads in a character b) Checks the keyboard buffer c) Nothing in particular (Its not defined there)
Explain dangling pointer.
What does n mean in c++?
Define Virtual function in C++.
To what does “event-driven” refer?
What are the differences between new and malloc?
What are protected members in c++?
Write a Program for dynamically intialize a 2 dimentional array. Eg:5x20, accept strings and check for vowels and display the no.finally free the space allocated .
Which software is best for coding?
Do you know about C++ 11 standard?
Is c++ primer good for beginners?