Sail E0 Webinar
Question


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
Options:
A .  No exception arises
B .  The object is null
C .  Error
D .  None of the mentioned
Answer: Option B

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 ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers