what is the behaviour of C and C++ compiler for the below
statements.
int *p;
p = malloc(100);
Is the behaviour same ? or different ?
Answers were Sorted based on User's Feedback
Answer / venu
we should explicitly typecast. Otherwise it is give a
compilation error.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / 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 |
Differentiate between late binding and early binding. What are the advantages of early binding?
Write a Program to find the largest of 4 no using macros.
Why is c++ a mid-level programming language?
What is pointer to array in c++?
What do you mean by C++ access specifiers ?
What is the type of this pointer in c++?
How come you find out if a linked-list is a cycle or not?
Can a list of string be stored within a two dimensional array?
What issue do auto_ptr objects address?
What is DlgProc?
Write about the scope resolution operator?
Why is c++ so fast?