How to solve this problem???
I met a problem which confused me for a long time. Who can help me??
parts of code as followes:
#include < iostream >
#include <string.h>
using namespace std;
template<class T>
test(T fg){
if(strcmp("S",fg.c_str())==0)
cout<<"string\n";
if(fg==1)
cout<<"int\n";
}
int main(){
int intfg = 1;
test(intfg);
string str = "S";
test(str);
return 0;
}