what is the behaviour of C and C++ compiler for the below
statements.
int *p;
p = malloc(100);
Is the behaviour same ? or different ?
Answer Posted / pramodsingh_45
In "C" the implicit typecasting will be done from void* to
int* but in C++ we need to do explicit typecasting.
so in C++
p = (int*)malloc(100);
but in C
p = malloc(100) will also work.
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Explain Text Manipulation Routines?
What is microsoft c++ redistributable 2013?
What is stl containers in c++?
What does catch(…) mean?
What are c++ data types?
What's the order in which the local objects are destructed?
Write a Program to find the largest of 4 no using macros.
What do you mean by delegate? Can a user retain delegates?
Can you please explain the difference between static and dynamic binding of functions?
why is iostream::eof inside a loop condition considered wrong?
What is meant by const_cast?
Describe friend function & its advantages.
What is the best c++ compiler?
In what situations do you have to use initialization list rather than assignment in constructors?
What are references in c++?