Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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 does new do in c++?

0 Answers  


difference between the c++ and c languages

4 Answers   Wipro,


Why cout is used in c++?

0 Answers  


What is the difference between struct and class?

1 Answers  


How a new operator differs from the operator new?

0 Answers  


what are prototypes

4 Answers   Infosys, TCS,


Can we make any program in c++ without using any header file and what is the shortest program in c++.

0 Answers   MCN Solutions,


What are arrays c++?

0 Answers  


What does it mean to declare a member function as virtual?

0 Answers  


Explain the advantages of using friend classes.

0 Answers  


What is function prototyping? What are its advantages?

0 Answers  


check whether a no is prime or not.

3 Answers   TCS,


Categories