我试图将string类中的一个每一个字符转换为int类型,利用for循环即string[i]来实现,但是在使用stoi函数转换时一直报错,不知道是为什么
if(stoi(sN[i])==ifrequency[j];
######[Error] call of overloaded 'stoi(char&)' is ambiguous
if(stoi(sN[i])==ifrequency[j];
######[Error] call of overloaded 'stoi(char&)' is ambiguous
sN[i]是个字符啊,stoi要求的参数是字符串。你把sN和ifrequency的定义都贴出来看看。另外if语句后面是不需要分号的