What is the error of the following program?
<< "to receive the integer number, "
Solutions:
take note that the symbol "ampersand" or "&" cannot be used as
the function parameter passed by value to receive the integer number,
the actual function caller argument, from the main() function body
error: no matching function for call to 'add<int>(int)'
note 1: candidate: 'template<class T> void add(T&)'
note 2: template argument deduction/substitution failed
note 3: cannot convert '1' (type 'int') to type 'int&'
error: note: cannot convert '1' (type 'int') to type 'int&'
Solution:
ampersand or & error at the function parameter
you cannot have the symbol "ampersand" or "&" as the function parameter passed by value,
remove the symbol ampersand or &
No comments:
Post a Comment