Sail E0 Webinar
Question


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
Options:
A .  binding
B .  rebinding
C .  both a & b
D .  none of these
Answer: Option C

Answer:d
Explanation:
In this program, We are using the non-type template parameter to increment the value in the function template.
Output:
$ g++ farg4.cpp
$ a.out
2.1
3.1
4.1



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers