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)