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 |
What are the advantages of C++ programming compared to C programming?
Is arr and &arr are same expression for an array?
What is late binding c++?
what are the types of Member Functions?
If you want to share several functions or variables in several files maitaining the consistency how would you share it?
Is sorted c++?
What's the hardest coding language?
what is VOID?
Write a program and call it sortcheck.cpp which receives 10 numbers from input and checks whether these numbers are in ascending order or not. You are not allowed to use arrays. You should not define more than three variables
What are single and multiple inheritances in c++?
write a C++ programming using for loop: * * * * * * * * * *
How to create a pure virtual function?