#include <iostream>
using namespace std;
template <class T, class T2>
T2 sum(T2 a, T b) {
T2 sum;
cout << a;// value i am getting when printed aa -> 24929 ab-> 24930
sum = a + b;
return sum;
}
void main() {
//cout << sum(2, 4);
cout << sum('aa', 'b');
}
Asked
Active
Viewed 20 times
0
-
`'aa'` is not a string _and_ not valid. `'b'` in this case would be interpreted as `char` – Chad Mar 09 '17 at 15:14
-
2`void main` is not legal C++. You need better learning material. – Baum mit Augen Mar 09 '17 at 15:14