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

Can we inherit constructor in c++?

601


Can we delete this pointer in c++?

692


Name the debugging methods that are used to solve problems?

591


You want to link a c++ program to c functions. How would you do it?

549


Explain the isa and hasa class relationships. How would you implement each?

624






What is c++ vb?

618


Can you please explain the difference between overloading and overriding?

611


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

943


Is it possible to provide default values while overloading a binary operator?

778


Name the implicit member functions of a class.

606


If you don’t declare a return value, what type of return value is assumed?

549


What is stack unwinding?

619


write a corrected statement in c++ so that the statement will work properly. x = y = z + 3a;

1467


How do you master coding?

578


How does atoi function work?

636