linux下sqlite用c语言回调函数操作数据库

#include 
#include 
#include 

/*回调函数,在每一行都会执行*/

// int sqlite3_exec(
//   sqlite3*,                                  /* An open database */
//   const char *sql,                           /* SQL to be evaluated */
//   int (*callback)(void*,int,char**,char**),  /* Callback function */
//   void *,                                    /* 1st argument to callback */
//   char **errmsg                              /* Error msg written here */
// );
//这个函数相当于打印一行
int showresult(void *unused,int count,char **argv,char **colname)
{
    for(int i=0;i

你可能感兴趣的:(sqlite)