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 is the C-style character string?
What is the difference between while and do while loop?
Can I have a reference as a data member of a class? If yes, then how do I initialise it?
How a new element can be added or pushed in a stack?
What does flush do?
What is the keyword auto for?
What is a singleton c++?
What's the order in which the local objects are destructed?
What causes a runtime error c++?
What is c++ and its uses?
What is a class template in c++?
What is the best c++ compiler for windows 10?
Why cstdlib is used in c++?
List different attributes in C++?
What do manipulators do?