Suppose the swapValues template is instantiated as follows:
int x = 2,y =3;
swapValues(x,y);
// use x and y
x = 4;y =5;
swapValues(x,y);
// use x and y
The compiler generates code for two copies of the swapValues template.
Correct Answer:
Verified
Q11: It is possible to have more than
Q12: Templates provide an overloading of the function
Q13: Templates allow only parameterized types for functions.
Q14: A class template can be derived from
Q15: In the implementation of a class template
Q17: In the template prefix,template<class T> the identifier
Q18: In writing a class template,the function declarations
Q19: A class template cannot be derived from
Q20: With regard to programming usage,consistency in coding
Q21: What is wrong with the following
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents