Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
class sample
4.
{
5.
public:
6.
sample()
7.
{
8.
cout
Options:
A .  X::operator=(X const &)
B .  X::X( X const & )
C .  X::X()
D .  None of the mentioned
Answer: Option C

As we are passing the object without any attributes it will return as X::X().
Output:
$ g++ large.cpp
$ a.out
X::X()



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers