In this program, we will get the SQLite version using the sqlite3_version() function. The sqlite_version() function returns the string that contains the SQLite version.
The source code to get the SQLite version is given below. The given program is compiled and executed successfully on Ubuntu 20.04.
//C program to get the installed version of sqlite.
printf("Sqlite version: %s\n", ver);
$ gcc version.c -o version -lsqlite3 -std=c99
Sqlite version: 3.31.1
In the above program, we included the sqlite3.h header file to uses sqlite3_libversion() function. Here, we created a character array ver and then we copied the SQLite version to the ver variable and then we printed the SQLite version on the console screen.
total answers (1)
start bookmarking useful questions and collections and save it into your
own study-lists, login now to start creating your own collections.