Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
template
4.
class XYZ
5.
{
6.
public:
7.
void putPri();
8.
static T ipub;
9.
private:
10.
static T ipri;
11.
};
12.
template
13.
void XYZ::putPri()
14.
{
15.
cout
Options:
A .  template
B .  class
C .  no specialization
D .  None of the mentioned
Answer: Option A

Answer:d
Explanation:
In this program, We are passing the value of specified type and printing it by specialization.
Output:
$ g++ spec2.cpp
$ a.out
1
1
1.2



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers