Skip to content

Instantly share code, notes, and snippets.

@atoz-programming-tutorials
Last active November 10, 2018 04:17
Show Gist options
  • Save atoz-programming-tutorials/b19fa34878631a3dffede3380bc17d87 to your computer and use it in GitHub Desktop.
Save atoz-programming-tutorials/b19fa34878631a3dffede3380bc17d87 to your computer and use it in GitHub Desktop.
Support for the video tutorial https://www.youtube.com/watch?v=wRnjahwxZ8A
#include <iostream>
#include <sqlite3.h>
int main() {
sqlite3 *db;
int fd = sqlite3_open("mydb.db", &db);
if (fd == SQLITE_OK) {
std::cout << "Success opening the database.\n";
}
else {
std::cerr << "Error:\n";
std::cerr << sqlite3_errmsg(db) << '\n';
exit(1);
}
sqlite3_close(db);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment