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
Write a short code using c++ to print out all odd number from 1 to 100 using a for loop
How are the features of c++ different from c?
What is a storage class used in c++?
Why c++ is not a pure oop language?
Mention the purpose of istream class?
What is the full form nasa?
Define 'std'.
Which programming language is best to learn first?
What is a terminating character in c++?
What are single and multiple inheritances in c++?
What does new in c++ do?
Is c++ faster than c?
Should the this pointer can be used in the constructor?
Where can I run c++ program?
How do you declare a set in c++?