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 |
why we cant create array of refrences
What is the difference between multiple and multilevel inheritance in c++?
What is lazy initialization in c++?
What is the use of data hiding?
Differentiate between a pointer and a reference with respect to c++.
Explain register storage specifier.
What is the difference between a class and a structure in C++?
What apps are written in c++?
What is the role of static keyword for a class member variable?
Define pointers?
What is virtual destructor? What is its use?
Why do we use classes in c++?