CSE MCQs :: C++ - MCQs
- What is a template?
- Pick out the correct statement about string template?
-
What is the output of this program?
#include < iostream >#include < string >using namespace std;template < typename T >void print_mydata(T output){cout << output << endl;}int main(){double d = 5.5;string s("Hello World");print_mydata( d );print_mydata( s );return 0;} - Which are done by compiler for templates?
- What may be the name of the parameter that the template should take?
- What is a function template?
- Which is used to describe the function using placeholder types?