int *p = NULL;
printf("%1d",p) ;
what will be the output of this above code?
Answers were Sorted based on User's Feedback
Answer / vasanth
Ans : 0
Since the pointer is having NULL Address,when we try to
print like printf("%1d",*p) it will be giving the exception
hence windows will not accept NULL pointer.
Use cout<<p; then we can print NULL address 0x00000000
Note: the ans is based on VC++ compiler.
Is This Answer Correct ? | 18 Yes | 0 No |
How would you use qsort() function to sort an array of structures?
What are the advantages of using a pointer? Define the operators that can be used with a pointer.
What is virtual function? Explain with an example
There is a array of 99 cells and we have to enter 1-100 elements in it , no two elements would repeat , so the is one no. missing because 99 cells and 1-100 nos. so we had to implement a function to find that missing no.
Why use of template is better than a base class?
What is a base class?
What is polymorphism in c++? Explain with an example?
Difference between a copy constructor and an assignment operator.
Define macro.
Is c++ still being used?
Why do we use setw in c++?
What is a dangling pointer?