This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <sqlite3.h> | |
using namespace std; | |
int main() | |
{ | |
// Pointer to SQLite connection | |
sqlite3* db; | |
// Save the connection result | |
int exit = 0; | |
exit = sqlite3_open("example.db", &db); | |
// Test if there was an error | |
if (exit) { | |
cout << "DB Open Error: " << sqlite3_errmsg(db) << endl; | |
} else { | |
cout << "Opened Database Successfully!" << endl; | |
} | |
// Close the connection | |
sqlite3_close(db); | |
return (0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment