The program won't link because the two functions int max(int, int) and char max(char, char) are not defined.

numnum (numnum)
In order to tell compiler that you are using a templated function, you have put the angle bracket after the function name: cout<<max<int>(i,i)<<encl;
2001-6-26 -04:00
This post has been archived. It cannot be replied.
Page address has been copied. To share, click to copy page address.
Share Online by QR Code

Back To Topic: C++中模板函数的重载

Back To Forum: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论