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?

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


Please Help Members By Posting Answers For Below Questions

What is the C-style character string?

1221


What is the difference between while and do while loop?

1205


Can I have a reference as a data member of a class? If yes, then how do I initialise it?

1282


How a new element can be added or pushed in a stack?

1061


What does flush do?

1051


What is the keyword auto for?

1089


What is a singleton c++?

1047


What's the order in which the local objects are destructed?

1309


What causes a runtime error c++?

1197


What is c++ and its uses?

1298


What is a class template in c++?

1100


What is the best c++ compiler for windows 10?

1091


Why cstdlib is used in c++?

1098


List different attributes in C++?

1148


What do manipulators do?

1068