Hi,
there is that thing that i need to handle atoi () function error.. Now for explanation atoi ( some const char * which is int (like '1') ) gives me that int, but if i write like this atoi ( 'n' ) then shit happens and it return's a 0.
So in order to do something when wrong happens i logicaly would do so:
if ( atoi ( (const char *) some_char ) == 0 )
{
/*<...>
things i want to do
<...>*/
}
but my linux console say's segmentation fault after i run my compiled program with that kind of thing.
So how can i control that error, so i could do things i want when things go bad ? or i should use another conversion from char to int (but that conversion would have to say when things are bad) ?