Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
template class A
4.
{
5.
public:
6.
A();
7.
int value;
8.
};
9.
template class A
10.
{
11.
public: A();
12.
};
13.
template class A
14.
{
15.
public: A();
16.
};
17.
template A::A() : value(i)
18.
{
19.
cout
Options:
A .  6
B .  10
C .  6default10
D .  None of the mentioned
Answer: Option C

In this program, We are defining three templates and specializing it and passing the values to 

it and printing it.
Output:
$ g++ spec5.cpp
$ a.out
6default10



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers