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 |
Is c++ slower than c?
What is an object in c++?
How are Structure passing and returning implemented by the compiler?
what is meaning of isa and hsa
What is the difference between structure and class?
How is an Abstract Base Class(ABC) related to an "Abstract Data Type" (ADT)
Write a C++ Program to check whether a number is prime number or not?
write the programme that convert a interger to biniry number
What happens if an exception is throws from an object's constructor and from object's destructor?
How do you find out if a linked-list has an end? (I.e. The list is not a cycle)
Explain the properties and principles of oop.
How can I learn dev c++ programming?