Which of the things does not require instantiation?
Which parameter is legal for non-type template?
Why we use :: template-template parameter?
What is the output of this program?
1. #include2. 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
What is the output of this program?
1. #include2. 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. }