Answers for "how to make a sqlite3 object in cpp"

C++
1

how to make a sqlite3 object in cpp

#include <iostream>
#include "sqlite3.h" //download: https://www.sqlite.org/download.html

sqlite3* access(std::string path){
	sqlite3* _db;
	int file_exist = _access(path.c_str(), 0);
	int res = sqlite3_open(path.c_str(), &_db);
	if (res != SQLITE_OK) {
		_db = nullptr;
		std::cout << "Failed to open DB" << std::endl;
    }
    retuern _db;
}
Posted by: Guest on May-02-2022

Code answers related to "how to make a sqlite3 object in cpp"

Browse Popular Code Answers by Language