John Carson said:
Try supplying a complete compileable sample that produces the error. The
three lines you have supplied compile fine with both VC++ 2002 and Comeau
online.
I don't know if this will help, but here's the full function. However, to
provide enough context to make it fully compileable would draw in thousands
of lines of code. So, this is the best I can do, but I understand if it's
not enough context and doesn't help... (BTW my platform is VC++ 7.1, but I
suppose that shouldn't matter; famous last words...)
void Sell::ChangeSale()
{
std::string::size_type first_char;
std::string::size_type idx;
std::string::size_type last_char;
int num_tabs;
std::string one_line;
std::string percent;
int total(0);
for (int i = 0; i < mVisibleMatchUps_psxListBox->count(); ++i)
{
one_line = std::string(mVisibleMatchUps_psxListBox->text(i));
num_tabs = std::count(one_line.begin(), one_line.end(), '\t');
if (num_tabs < 7)
continue;
idx = one_line.find('\t', 0);
first_char = idx + 1;
last_char = one_line.find('\t', first_char) - 1;
if (last_char < first_char)
continue;
percent = one_line.substr(first_char, last_char - first_char + 1);
total += atoi(percent.c_str());
}
mVisibleMatchUps_psxListBox->storeData() ;
DeleteSale() ;
AddSale() ;
}//ChangeSale(...