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

Describe new operator and delete operator?

0 Answers  


Implement a 2 dimensional array by one dimentional array

1 Answers   CTS,


What is abstraction in c++?

0 Answers  


What do you understand by zombie objects in c++?

0 Answers  


What about Virtual Destructor?

1 Answers   Virtusa,






What is #include cmath?

0 Answers  


What is the best way to take screenshots of a window with c++ in windows?

0 Answers  


What is void pointer in c++ with example?

0 Answers  


What happens if an exception is throws from an object's constructor and from object's destructor?

3 Answers   TCS,


How is objective c different from c++?

0 Answers  


What is this weird colon-member (" : ") syntax in the constructor?

0 Answers  


Define 'std'.

0 Answers  


Categories