Question
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
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
Answer: Option A
Was this answer helpful ?
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 ?
More Questions on This Topic :
Question 4.
What is meant by template specialization?
....
Submit Solution