我用C++連接mysql來完成一些操作,這是我的代碼的一部分。我想知道爲什麼兩個輸出不同
const char* deleteLog_query = DeleteLog(userIDstr).c_str();
cout<<deleteLog_query<<endl;
const char* deleteReplyOfLog_query = DeleteReplyOfLog(userIDstr).c_str();
mysql_query(&mysql_conn,deleteReplyOfLog_query);
mysql_result = mysql_store_result(&mysql_conn);
const char* deleteShareOfLog_query = DeleteShareOfLog(userIDstr).c_str();
mysql_query(&mysql_conn,deleteShareOfLog_query);
mysql_result = mysql_store_result(&mysql_conn);
cout<<deleteLog_query<<endl;
mysql_query(&mysql_conn,deleteLog_query);
mysql_result = mysql_store_result(&mysql_conn);
if(mysql_result!=0) cout<<"\t right delete!"<<endl;
這是輸出:
這不是C .. –