Solved

What Is Wrong with the Following Function Template (Other Than \quad

Question 21

Essay

What is wrong with the following function template (Other than the fact that it really does almost nothing)?
template<class T>
int f( int & x )
{
\quad return x;
}
int main()
{
\quad int y = 3,z;
\quad z = f(y);
}

Correct Answer:

verifed

Verified

There is a rule "Every template argument...

View Answer

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents