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 come you find out if a linked-list is a cycle or not?
How long does this loop run: for(int x=0; x=3; x++) a) Never b) Three times c) Forever
17 Answers Datavance, Quark, VEL, Wipro,
class Foo { public: Foo(int i) { } }; class Bar : virtual Foo { public: Bar() { } }; Bar b; Referring to the above code, when the object 'b' is defined, a compiler error will occur. What action fixes the compiler error? a) Adding a virtual destructor to the class Bar b) Adding a constructor to Bar which takes an int parameter c) Adding "Foo()" to the Bar constructor d) Adding a copy constructor to the class Foo e) Adding "Foo(0)" to the Bar::Bar initializer list
What language does google use?
What are advantages and disadvantages of Design patterns?
what Is DCS ? what i will get benefit when i did?
What is overloading unary operator?
how many trys can we write in one class
Will this c++ program execute or not?
What is c++ virtual inheritance?
describe private access specifiers?
What is boyce codd normal form in c++?