int *p = NULL;
printf("%1d",p) ;

what will be the output of this above code?

Answers were Sorted based on User's Feedback



int *p = NULL; printf("%1d",p) ; what will be the output of this above code?..

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

int *p = NULL; printf("%1d",p) ; what will be the output of this above code?..

Answer / sourisengupta

0

Is This Answer Correct ?    5 Yes 0 No

int *p = NULL; printf("%1d",p) ; what will be the output of this above code?..

Answer / ravi

undefined

Is This Answer Correct ?    0 Yes 13 No

Post New Answer

More C++ General Interview Questions

What are static type checking?

0 Answers  


What are the basics of local (auto) objects?

0 Answers  


Why is standard template library used?

0 Answers  


What language is a dll written in?

0 Answers  


write a function signature with various number of parameters.

0 Answers  


What is c++ try block?

0 Answers  


i want to know how to copy arrary without using any method or function. I have tried the below using System; class e4 { static void Main(string[] args) { int a,b; int[ ] m= new int[5]; int[ ] n= new int[5]; for(a=0;a<=4;a++) { Console.WriteLine("enter any value"); m[a]=Convert.ToInt32(Console.ReadLine()); m[a]=n[a]; } for(b=0;b<=4;b++) { Console.WriteLine(n[b]); } } } but it will give wrong result can anyone solve this problem

1 Answers   Reliance,


What are guid? Why does com need guids?

0 Answers  


What is the use of lambda in c++?

0 Answers  


Please explain class & object in c++?

0 Answers  


Can we delete this pointer in c++?

0 Answers  


When should overload new operator on a global basis or a class basis?

0 Answers  


Categories