Hi

I sent this message previously, but it ended being a reply in another thread 
which was not my intention. So let’s try one more time...

I have an Objective-C iPhone application developed using Xcode. I have a 
singleton object which serves as the database controller. I use the SQLite C 
APIs to interact with the database. It works really well but I’m curious about 
something.

In my app, I declare my database instance variable like this. (It is a member 
of the DatabaseController class)

sqlite3 *_database;

My usage is like this:

int openCode = sqlite3_open(databasePathC, &_database);

I was poking around in FMDB’s source code on github. FMDB is a widely used 
Objective-C wrapper around SQLite. I was looking to see what they do out of 
curiosity.  FMDB declares and uses the database variable like this:

void *_database;

int openCode = sqlite3_open(databasePathC, (sqlite3**)&_database);

So my question is this: is there some advantage to declaring the database 
variable as a void pointer and casting it as sqlite3 verses just declaring it 
as sqlite3?

Thanks for creating SQLite!

Greg Moore
thewatchful...@gmail.com
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to