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().
Answers were Sorted based on User's Feedback
Answer / pankaj rathor
#include <iostream>
using namespace std;
class dummy
{
public:
dummy()
{
cout<<"Hai Arvind ";
}
~dummy()
{
cout<<" 99999999999";
}
};
dummy obj;
int main()
{
cout<<"my no. is";
return 0;
}
| Is This Answer Correct ? | 15 Yes | 2 No |
Answer / 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 |
How to construct muliton object
What are abstract data types in c++?
Is java based off c++?
What can c++ be used for?
What is a stack? How it can be implemented?
Explain shallow copy?
Is python written in c or c++?
Can you please explain the difference between overloading and overriding?
Write a program using GUI concept for the scheduling algorithms in Operating system like SJF,FCFS etc..
What is meant by const_cast?
What is ios in c++?
What is function declaration in c++ with example?