السلام عليكم
الكود التالي حول القوالب والتحميل الزائد للدوال
#include <iostream>
using namespace std;
template <class N,class h>
N hi(N q,N x)
{
return q+x;
}
h hi(N a,N b)
{
h xxi = (a==b);
return xxi;
}
int multiple(int,int);
double multiple(double,double);
int main()
{
int bx = hi(6,6);
cout << bx << '\n';
char bh = hi('1','0');
cout << bh << '\n';
bool xx = hi(0,9);
cout << "0 And 9 Is Equal = " << xx << '\n';
cout << "9 * 9 is " << multiple(9,9) << '\n';
cout << "9.9 * 9.9 is " << multiple(9.9,9.9) << '\n';
return 0;
}
int multiple(int a,int b)
{
return (a*b);
}
double multiple(double a,double b)
{
return (a*b);
}الخطأ
X:\c++\Pc+\c++\tst\t\main.cpp|17|error: no matching function for call to 'hi(int, int)'|
السلام عليكم ورحمة الله