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 |
write a program that will produce the ff. output. "what fruit will you buy? 1)apple 2)orange 3)mango ENTER CHOICE (1,2 or 3)> HOW MANY WILL YOU BUY?> THAT WILL COST XX.XX
What is the role of copy constructor in copying of thrown objects?
Is c++ a good first language to learn?
What is the output of printf("%d")?
58 Answers CTS, HCL, Infosys, TCS, Winit, Wipro,
Which is best ide for c++?
Explain the use of vtable.
Can I have a reference as a data member of a class? If yes, then how do I initialise it?
Can malloc be used in c++?
What happens when you make call 'delete this;'?
Will c++ be replaced?
If there are two catch statements, one for base and one for derived, which should come first?
what is polymorphism?