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...

given the code segment below
void main()
{
cout<<"my no. is";
}
question is how can we get the output hai aravind my no. is
99999999999 without editig the main().

Answer Posted / sunil chopra

Overload the << operator.

ostream& operator << (ostream& ot, const char* chr)
{
using std::operator<<;
return ot << "Hai Arvind " << chr << " 99999999999";
}

Is This Answer Correct ?    9 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is purpose of new operator?

1126


Explain data encapsulation?

1168


Explain the volatile and mutable keywords.

1116


Which operations are permitted on pointers?

1043


What are friend classes? What are advantages of using friend classes?

1139


Explain the concept of copy constructor?

1108


Can we change the basic meaning of an operator in c++?

1159


How do you generate a random number in c++?

1151


What is the use of map in c++?

1194


Does std endl flush?

1095


Can user-defined object be declared as static data member of another class?

1076


Explain what is class definition in c++ ?

1197


What are member functions used in c++?

1208


What are the advantages of pointers?

1121


Is there a sort function in c++?

1053