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
What is time h in c++?
Define stacks. Provide an example where they are useful.
How do we balance an AVL Tree in C++?
What is a hash function c++?
What is a local variable?
Tell me what are static member functions?
Which c++ compiler is best?
What is a tuple c++?
Why is c++ awesome?
How to declare an array of pointers to integer?
Can you explicitly call a destructor on a local variable?
Why is c++ still used?
What is #include sstream?
What is a rooted hierarchy?
I want to write a C++ language program that: 1. Reads in the size of a square from the screen; 2. Prints a hollow square of that size out of “-“, “|” and blanks on screen; 3. Prints the same hollow square onto a text file. The program should work for squares of all side sizes between 1 and 20.