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 |
Explain virtual class and friend class.
Explain the scope resolution operator?
How can you tell what shell you are running on unix system?
Define a pdb file.
Profiler in projects?
Write a c++ code that will calculate the roots of a quadratic equation a2+ bx+c=0 Hint: d = sqrt (b2-4ac), and the roots are: x1 = (€“b + d)/2a and x2 = (€“b €“ d)/2a (use sqrt function from cmath.h )?
Can turbo c++ run c program?
What is the difference between method and message?
How is memory managed in C++?
What is meant by forward referencing and when should it be used?
When should overload new operator on a global basis or a class basis?
simple c++ program for "abcde123ba" convert "ab321edcba" with out using string