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


Please Help Members By Posting Answers For Below Questions

What does ios :: app do in c++?

546


What is the use of turbo c++?

541


What is enum class in c++?

692


What does 7/9*9 equal ? a) 1 b) 0.08642 c) 0

570


What are the characteristics of friend functions?

551






If a function doesn’t return a value, how do you declare the function?

600


Which is the best c++ compiler?

577


Name four predefined macros.

582


Where are setjmp and longjmp used in c++?

600


What is namespace std; and what is consists of?

646


What is meant by a delegate?

594


Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;

1491


How can I learn dev c++ programming?

553


what is pre-processor in C++?

581


Explain how a pointer to function can be declared in C++?

567