July 14th, 2003, 03:34 PM
clear ostrstream problem
I am having a problem using the ostrstream class. The following piece of code:
static ostrstream strbuf;
pBuffer = &strbuf;
strbuf << "insert into DayTimeStamp_01 values (" << *(msgCounter) << "," << days << "," << hours << "," << mins << "," << secs << ")";
Query *myQuery = &queryTimeStamp;
will execute approx 10+ times before it stops working. The above code is trying to insert values into a mysql database using the mysql++ api.
I was just wondering if the above looked like an appropriate solution to reusing an ostrstream.
edit: might have helped to add my doQuery function
void doQuery(Query *myQuery, ostrstream *strbuf)
Last edited by kidakira; July 14th, 2003 at 04:04 PM.