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 pointer with example?
Write a program using merge () function to combine the elements of array x[ ] and y[ ] into array z[ ].
How many namespaces are there in c++?
What are advantages of using friend classes?
What is meant by iomanip in c++?
What is the use of endl?
What are stacks? Give an example where they are useful.
What is the extraction operator and what does it do?
What is c++ and its uses?
What are the storage qualifiers?
How to demonstrate the use of a variable?
State the difference between pre and post increment/decrement operations.
Explain about Garbage Collector?
What are the three forms of cin.get() and what are their differences?
What do manipulators do?