在这里,我试图通过 insertQuery 连接变量(int 和 char),但出现错误,我的错误是错误:类型为 'const char*' 和 'const char [2]' 的无效操作数到二进制 'operator+'伙计们请指导我哪里错了..
**string insertQuery= "insert into items (user_id,session_id,user_sessionname,buffer)values("
+ user + "," + session + ",'" + usrname + "','" + buff + "')";
sqlite3_stmt *insertStmt;
cout << "Creating Insert Statement" << endl;
sqlite3_prepare(db, insertQuery.c_str(), insertQuery.size(), &insertStmt, NULL);
cout << "Stepping Insert Statement" << endl;
if (sqlite3_step(insertStmt) != SQLITE_DONE) cout << "Didn't Insert Item!" << endl;**