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
When should you use global variables?
What is boyce codd normal form in c++?
Do we have to use initialization list in spite of the assignment in constructors?
What is the difference between map and hashmap in c++?
What is the use of endl?
What is array give example?
Differentiate between an external iterator and an internal iterator? What is the advantage of an external iterator.
Can we distribute function templates and class templates in object libraries?
Which should be more useful: the protected and public virtuals?
Please explain class & object in c++?
Const char *p , char const *p What is the difference between the above two?
How many characters are recognized by ANSI C++?
What do you mean by vtable and vptr in c++?
Can a program run without main function?
How many types of modularization are there in c++?