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 are multiple inheritances (virtual inheritance)?

1062


Is arr and &arr are same expression for an array?

1057


What do you mean by stack unwinding in c++?

1234


What would happen on forgetting [], while deallocating an array through new?

1093


What is an operator in c++?

1068


What is a block in c++?

1054


Is c++ a good first language to learn?

1073


How do I get good at c++ programming?

1173


What is the difference between set and map in c++?

1136


How the programmer of a class should decide whether to declare member function or a friend function?

1122


Define a constructor?

1055


Explain dangling pointer.

1133


Describe private, protected and public?

1081


What is class in c++ with example?

1281


If a function doesn’t return a value, how do you declare the function?

1065