Я написал простую тестовую программу на C++ для проверки исключений:
#include
#include
inline bool isNumber(char c);
inline unsigned stringToNum(const char *str) {
unsigned x = 0;
const char *p = str;
while(1) {
if( !isNumber(*p) ) {
if( *p == 0 && p != str )
break;
throw 0;
}
x = x * 10 + *p++ - '0';
}
return x;
}
inline bool isNumber( char c ) {
return c >= '0' && c
Подробнее здесь: https://stackoverflow.com/questions/110 ... seg-faults
Мобильная версия