我使用Qt Creator和验证码:如何解决 “类型 '为const char []' 和 '为const char *' 的无效操作数为二进制 '运营商+'”
string execpath = "";
execpath += (QCoreApplication::applicationDirPath()).toStdString();
WinExec("ffmpeg -f dshow -t 32 -i audio=\"virtual-audio-capturer\" -y "+(execpath.c_str())+"\\sound.mp3", SW_HIDE); // Loopback captured in sound.mp3
第3行产生这个问题:
类型的无效操作数 '为const char [60]' 和 '为const char *' 来 二进制 '运营商+'
如何解决呢?
不能与+运营商加在一起C风格的字符串第一 – Brian
在连接字符串和*然后*调用'.c_str('级联'的std :: string' – Brian