tags:

views:

504

answers:

2

Like this: const void * test = sqlite3_column_blob(stat, 1); Can I delete or delete[] test?

+1  A: 

Look at its API Manual. If it is a C API, you probably have to free it. If it doesn't provide its own function like sqlite3_free (pcre does this for example), you have to use that function.

What you can't do is delete it using C++'s delete operator, since you have got a void pointer. You cannot delete a void pointer, since the compiler has to know about its type. (and void is an incomplete type. you can't delete incomplete types either).

Johannes Schaub - litb
+2  A: 

From the sqllite documentation:

The pointers returned are valid until a type conversion occurs or until sqlite3_step() or sqlite3_reset() or sqlite3_finalize() is called. The memory space used to hold strings and BLOBs is freed automatically. Do not pass the pointers returned by sqlite3_column_blob() into sqlite3_free().

Rick