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 the programmer of a class should decide whether to declare member function or a friend function?
Write is a binary search tree? Write an algo and tell complexity?
Write a short code using c++ to print out all odd number from 1 to 100 using a for loop
Why do we use using namespace std in c++?
What are the static members and static member functions?
What are function prototypes?
how many trys can we write in one class
which one is equivalent to multiplying by 2:Left shifting a number by 1 or Left shifting an unsigned int or char by 1?
What are move semantics?
Is there a new/delete equivalent of realloc?
Why is c++ a mid-level programming language?
Can you think of a situation where your program would crash without reaching the breakball, which you set at the beginning of main()?