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
what is multi-threading in C++?
How do you flush std cout?
Why is main function important?
Explain pass by value and pass by reference.
What do you mean by friend class & friend function in c++?
What is the size of integer variable?
What are smart pointers?
What type of question are asked in GE code writing test based on c++ data structures and pointers?
Define pointers?
What sorting algorithm does c++ use?
Define upcasting.
In a function declaration what does extern means?
What is helper in c++?
What is an html tag?
Can circle be called an ellipse?