List:MySQL++« Previous MessageNext Message »
From:Guowen Han Date:October 24 2007 12:31pm
Subject:Re: Problem with "mysqlpp:Result"
View as plain text  
There are two problems I can see.
1. there is no end control for variable i
2. res is a vector (i guess), res.at(i) will out of boundary when i is 
exceed the size




ALeX <logocomune@stripped> 
10/24/2007 06:29 AM

To
plusplus@stripped
cc

Subject
Problem with "mysqlpp:Result"






I have this little problem, if i use this code of exemple:
if (res) {
                                 mysqlpp::Row row;
                                 mysqlpp::Row::size_type i;
                                 for (i = 0; row = res.at(i); ++i) {
                                                 cout << '\t' << row.at(0) 
<< endl;
                                 }
                 }
My executable stop with "This application has requested the Runtime to
terminate it in an unusual way.Please contact the application's
support team for more information."

I solve with this trick...
if (res) {
   mysqlpp::Row row;
   mysqlpp::Row::size_type i;
   for (i = 0; i < res.size(); ++i){
       row = res.at(i);
  out << '\t' << row.at(0) << endl;
   }

My question is why the first code rise errors?

-- 
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe:    http://lists.mysql.com/plusplus?unsub=1




-----------------------------------------
________________________________________________________
DTCC DISCLAIMER: This email and any files transmitted with it are
confidential and intended solely for the use of the individual or
entity to whom they are addressed. If you have received this email
in error, please notify us immediately and delete the email and any
attachments from your system. The recipient should check this email
and any attachments for the presence of viruses.  The company
accepts no liability for any damage caused by any virus transmitted
by this email.
Thread
Problem with "mysqlpp:Result"ALeX24 Oct
  • Re: Problem with "mysqlpp:Result"Warren Young24 Oct
  • Re: Problem with "mysqlpp:Result"Guowen Han24 Oct