It seemed to me that I understood the basics of pointers, but after checking some documentation on some sqlite3 methods, I was thrown, so now I'm not sure that my understanding is correct.
Here is the sqlite3 method call:
char* dataFilePath = "foobar.sqlite";
if (sqlite3_open(dataFilePath, &database) != SQLITE_OK) {...}
And here is the function header declaration:
int sqlite3_open(
const char *filename,
sqlite3 **ppDb
);
Why does the database suddenly become a pointer to a pointer?
Another method call to close the database connection: sqlite3_close (database);
In the function header:
int sqlite3_close(sqlite3 *);
Why is it just a pointer when I pass a pointer? Would it be a pointer to a pointer?
Of all the examples that I saw, it always seemed to be the reverse of the above functions, i.e.
void foo(someDataType *bar) { ... }
foo(&bar);
Thanks for the help.
chris source
share