Template Arguments to Specify Policy Usage

1

Which of the things does not require instantiation?

A. functions
B. non virtual member function
C. member class
D. all of the mentioned

2

Which parameter is legal for non-type template?

A. pointer to member
B. object
C. class
D. none of the mentioned

3

Why we use :: template-template parameter?

A. binding
B. rebinding
C. both a & b
D. none of these

4

What is the output of this program?

1.
    #include 
2.
    using namespace std;
3.
    template 
4.
    void loopIt(T x)
5.
    {
6.
        T val[count];
7.
        for(int ii = 0; ii < count; ii++)
8.
        {
9.
            val[ii] = x++;
10.
            cout <<  val[ii] << endl;
11.
        }
12.
    };
13.
    int main()
14.
    {
15.
        float xx = 2.1;
16.
        loopIt(xx);
17.
    }

a) 2.1

b) 3.1

c) 4.1

d) 2.1

3.1

4.1


5

What is the output of this program?

1.
    #include 
2.
    using namespace std;
3.
    template 
4.
    class Test
5.
    {
6.
        public:
7.
        Test()
8.
        {
9.
        };
10.
        ~Test()
11.
        {  
12.
        };
13.
        type Funct1(type Var1)
14.
        {
15.
            return Var1;
16.
        }
17.
        type Funct2(type Var2)
18.
        {
19.
            return Var2;
20.
        }
21.
    };
22.
    int main()
23.
    {
24.
        Test Var1;
25.
        Test Var2;
26.
        cout << Var1.Funct1(200);
27.
        cout << Var2.Funct2(3.123);
28.
        return 0;
29.
    }
A. 100
B. 200
C. 3.123
D. 2003.123