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 low level language in simple words?
Describe private, protected and public?
What is c++ vb?
What is the difference between the compiler and the preprocessor?
Function can be overloaded based on the parameter which is a value or a reference. Explain if the statement is true.
What are the differences between malloc() and calloc()?
What does it mean to declare a member function as virtual?
What does floor mean in c++?
Write about the various sections of the executable image?
What is a stack c++?
Write a function to find the nth item from the end of a linked list in a single pass.
Write about the access privileges in c++ and also mention about its default access level?
How are the features of c++ different from c?
Why we use #include iostream in c++?
In what situations do you have to use initialization list rather than assignment in constructors?