What is the output of this program?
#include <iostream>
using namespace std;
template <typename T, int count>
void loopIt(T x)
{
T val[count];
for(int ii = 0; ii < count; ii++)
{
val[ii] = x++;
cout << val[ii] << endl;
}
};
int main()
{
float xx = 2.1;
loopIt<float, 3>(xx);
}
a) 2.1
b) 3.1
c) 4.1
d) 2.1
3.1
4.1
Submitted by: Administratord) 2.1
3.1
4.1
Submitted by:
3.1
4.1
Submitted by:
Read Online C++ Template Job Interview Questions And Answers
Top C++ Template Questions
☺ | What is Template class? |
☺ | What is Cass template? |
☺ | Please tell me how is static data member similar to a global variable? |
☺ | Tell us what is the STL, standard template library? |
☺ | What is Class element in C++? |
Top C Plus Plus Language Categories
☺ | C++ Pointers & Functions Interview Questions. |
☺ | C++ Operator Overloading Interview Questions. |
☺ | C++ Exception Handling Interview Questions. |
☺ | C++ Virtual Functions Interview Questions. |
☺ | C++ Template Interview Questions. |