glibc
glibc copied to clipboard
what's wrong?
hey,guys
I'm a chinese;my english is terrible;
I'd like to you,i got a bug,you can help me?
I used c sqlite api on c++,then,when i used lambda func as sqlite3_exec()'s callback params,but got "Sqlite error: query aborted",and only got a record,this is c and c++ incompatible ?
__callback callback = [](void *data, int argc, char **argv, char **azColName) -> int { int i; for (i = 0; i < argc; i++) { printf("%s = %s\n", azColName[i], argv[i] ? argv[i] : "NULL"); } };
rc = sqlite3_exec(db, dml.c_str(), callback , data, &zErrMsg); if (SQLITE_OK != rc) { std::cerr << "Sqlite error: " << zErrMsg << std::endl; sqlite3_free(zErrMsg); return false; }
thanks!