Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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;
}
 
PREVIOUS NEXT
Tagged: #object #cpp
ADD COMMENT
Topic
Name
4+9 =