c++ 调用 sqlcipher
#include <iostream> #include <string.h> #include "sqlite3.h" using namespace std; static int callback(void *notUsed, int argc, char **argv, char **azColName) { for (int i = 0; i < argc; i++) cout << azColName[i] << ":" << (argv[i] ? argv[i] : "NULL") << "\t"; cout << endl; return 0; } void dbTest() { #pragma region 打开或创建数据库 /*打开或创建的数据库实例句柄*/ sqlite3 *db = NULL; /*数据库文件的路径及文件名*/ const char* path = "./sqlcipher.db"; /*根据文件路径打开数据库连接。如果数据库不存在,则创建。数据库文件的路径必须以C字符串传入*/ int result = sqlite3_open_v2(path, &db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_NOMUTEX | SQLITE_OPEN_SHAREDCACHE,