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 did c++ start?
What is the use of cmath in c++?
Why do we use pointers in c++?
What are the effects after calling the delete this operator ?
What is c++ hash?
What is setbase c++?
Write some differences between an external iterator and an internal iterator?
Write the program for fibonacci in c++?
Give example of a pure virtual function in c++?
founder of c++
7 Answers Microtek, TCS, TeleCommand,
How can you prevent accessing of the private parts of my class by other programmers (violating encapsulation)?
How can you quickly find the number of elements stored in a static array? Why is it difficult to store linked list in an array?