Question
1.
#include
2.
#include
3.
using namespace std;
4.
class Test
5.
{
6.
public:
7.
Test();
8.
virtual ~Test();
9.
};
10.
int main()
11.
{
12.
Test *ptrvar = NULL;
13.
try
14.
{
15.
cout
What is the output of this program?
1.
#include
2.
#include
3.
using namespace std;
4.
class Test
5.
{
6.
public:
7.
Test();
8.
virtual ~Test();
9.
};
10.
int main()
11.
{
12.
Test *ptrvar = NULL;
13.
try
14.
{
15.
cout
Answer: Option B
Was this answer helpful ?
As there is no object in the class, It is arising an exception in the program.
Output:
$ g++ std4.cpp
$ a.out
The object is null
Was this answer helpful ?
Submit Solution