I’m trying to pass my sqlite database through to a function and then through to another one again. Here is my code.
//database Name
// Create a handle for database connection, create a pointer to sqlite3
sqlite3 *dataDB;
//I send it through to the function here
// Execute the query for creating table
retval = sqlite3_exec(dataDB,create_students,0,0,0);
My prototypes:
int readInFiles(sqlite3 ** dataDB);
void addCourse(sqlite3 ** dataDB, struct course,int k);
Call from within the readInFiles function:
addCourse(&dataDB,deg,k);
Here is my error:
"database.c", line 50: warning: argument #1 is incompatible with prototype:
prototype: pointer to pointer to struct sqlite3 {} : "database.h", line 51
From within
readInFiles,dataDBis of typesqlite3**already, so you need to call: