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 queue. How it can be implemented?
Is std :: string immutable?
What is the use of object in c++?
What are references in c++?
how to explain our contribution in the project?
write asingle linked list which read from two list & the do the following 1 sort the prime & nonprime num (prime should be less tn nonprime) 2 each node has a prime num followd by nonprime 3 add a new node into its sutable plce 4 erase the most three duplicated non prime num 5 find the least duplicated prime num
What does n mean in c++?
What are the important differences between c++ and java?
What ANSI C++ function clears the screen a) clrscr() b) clear() c) Its not defined by the ANSI C++ standard
why is c++ called oops? Explain
What is a friend function in c++?
Explain what you mean by a pointer.
What are single and multiple inheritances in c++?
what is data encapsulation in C++?
Comment on c++ standard exceptions?