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
Can we inherit constructor in c++?
Can we delete this pointer in c++?
Name the debugging methods that are used to solve problems?
You want to link a c++ program to c functions. How would you do it?
Explain the isa and hasa class relationships. How would you implement each?
What is c++ vb?
Can you please explain the difference between overloading and overriding?
Of the numbers 12 23 9 28 which would be at the top of a properly implemented maxheap a) 28 b) 9 c) Any of them could be
Is it possible to provide default values while overloading a binary operator?
Name the implicit member functions of a class.
If you don’t declare a return value, what type of return value is assumed?
What is stack unwinding?
write a corrected statement in c++ so that the statement will work properly. x = y = z + 3a;
How do you master coding?
How does atoi function work?