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
Can we run c program in turbo c++?
If horse and bird inherit virtual public from animal, do their constructors initialize the animal constructor? If pegasus inherits from both horse and bird, how does it initialize animal’s constructor?
How are the features of c++ different from c?
What is static class data?
List different attributes in C++?
Are vectors faster than arrays?
Explain terminate() function?
Is it possible to have a recursive inline function in c++?
What does the ios::ate argument do?
What is the difference between structures and unions?
What are compilers in c++?
What are the two types of polymorphism?
Explain rtti.
How do you sort a sort function in c++ to sort in descending order?
Why do we use pointers in c++?