CArray<int,int> Add provoque un UserBreakPoint
Bonsoir
Quelqu'un aurait-il une idée du pourquoi cette fonction provoque un UserBreakPoint (non défini par moi) dans VC++6 en mode debug, au moment du Add
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| void stringSplitToInt(string str, string delim, CArray<int,int> *results)
{
int cutAt;
while( (cutAt = str.find_first_of(delim)) != str.npos )
{
if(cutAt > 0)
{
string tmp = str.substr(0,cutAt);
const char* tmp2 = tmp.c_str();
int tmp3 = atoi(tmp2);
(*results).Add(tmp3);
}
str = str.substr(cutAt+1);
}
if(str.length() > 0)
{
(*results).Add(atoi(str.c_str()));
}
} |