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 multi-threading in C++?

1047


How do you flush std cout?

1082


Why is main function important?

1096


Explain pass by value and pass by reference.

1048


What do you mean by friend class & friend function in c++?

1051


What is the size of integer variable?

1050


What are smart pointers?

2237


What type of question are asked in GE code writing test based on c++ data structures and pointers?

3973


Define pointers?

1035


What sorting algorithm does c++ use?

1134


Define upcasting.

1032


In a function declaration what does extern means?

1040


What is helper in c++?

1078


What is an html tag?

1128


Can circle be called an ellipse?

1071