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 a linked list in c++?
How much do coding jobs pay?
What is c++ hash?
Explain virtual class?
What's c++ used for?
What is the difference between the compiler and the preprocessor?
Explain the uses of static class data?
What is scope resolution operator in c++ with example?
What header file is needed for exit(); a) stdlib.h b) conio.h c) dos.h
What are references in c++?
What is a wchar_t in c++?
What is the use of map in c++?
How do I run c++?
What is c++ stringstream?
What are the advantages of pointers?