nshaw writes:
> Help!
>
> I've done everything I can think of to pass arguments to SQLite and
> nothing
> is working. If anyone has information on how to do it, I'd appreciate
it.
> Here's a code segment:
[edited to remove SQL3-related material]
> int main (int argc, char **argv)
> {
> char *sql;
> sql = "insert into family (member,age) values (name, age)"; //
------
> --
> HERE'S WHERE COMPILE BUSTS
This looks like a simple const violation; a string literal has type
"array of n const char", but you attempt to point a non-const char* into
it.
If this isn't the problem, maybe you can show what error you see.
You probably want to look at bind variables (sqlite3_bind_text) though,
to address the bigger issue (getting SQLite to read data from C++
variables).
(You appear to be writing something closer to C than idiomatic C++,
which may be a reasonable choice for you. For many people it would be
simpler to either use more of C++, such as using string objects, or to
stick to straight C. Sometimes though it makes sense to use C++ as "a
better C" with improved type checking etc. All of which is off-topic
here, and hopefully can be ignored by others instead of attracting
flames.)
-- James
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------