int *p = NULL;
printf("%1d",p) ;

what will be the output of this above code?

Answers were Sorted based on User's Feedback



int *p = NULL; printf("%1d",p) ; what will be the output of this above code?..

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

int *p = NULL; printf("%1d",p) ; what will be the output of this above code?..

Answer / sourisengupta

0

Is This Answer Correct ?    5 Yes 0 No

int *p = NULL; printf("%1d",p) ; what will be the output of this above code?..

Answer / ravi

undefined

Is This Answer Correct ?    0 Yes 13 No

Post New Answer

More C++ General Interview Questions

How did c++ start?

0 Answers  


What is the use of cmath in c++?

0 Answers  


Why do we use pointers in c++?

0 Answers  


What are the effects after calling the delete this operator ?

0 Answers  


What is c++ hash?

0 Answers  






What is setbase c++?

0 Answers  


Write some differences between an external iterator and an internal iterator?

0 Answers  


Write the program for fibonacci in c++?

20 Answers   TATA, Wipro,


Give example of a pure virtual function in c++?

0 Answers  


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)?

0 Answers  


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?

0 Answers  


Categories