int *p = NULL;
printf("%1d",p) ;
what will be the output of this above code?
Answer Posted / 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 |
Post New Answer View All Answers
What are multiple inheritances (virtual inheritance)?
Is arr and &arr are same expression for an array?
What do you mean by stack unwinding in c++?
What would happen on forgetting [], while deallocating an array through new?
What is an operator in c++?
What is a block in c++?
Is c++ a good first language to learn?
How do I get good at c++ programming?
What is the difference between set and map in c++?
How the programmer of a class should decide whether to declare member function or a friend function?
Define a constructor?
Explain dangling pointer.
Describe private, protected and public?
What is class in c++ with example?
If a function doesn’t return a value, how do you declare the function?