I want to store some value from SQLite database in my buffer, but the qlite3_column_text() has the following prototype:
const unsigned char *sqlite3_column_text(sqlite3_stmt*, int iCol);
then when I do:
out[size] = sqlite3_column_text(stmt, 0);
I get the following error message:
assignment discards qualifiers from pointer target type
I tried using strcpy() too, but I get same error message.
It’s easy with
strdup;Note that this will malloc the copy, so you have to call free() on the pointer later not to get a leak.
Of course this assumes that your
outarray can store values of the type char*, you’re not showing how it’s defined.