- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
#define C_WRONG -2000
....
int tttt_atoi(char* p_string){
int result = C_WRONG;
if ( *p_string < '0' || *p_string > '9' )
return C_WRONG;
result = atoi(p_string);
return result;
}
double tttt_atof(char* p_string){
double result = C_WRONG;
result = atof(p_string);
if (result!=0){
return result;
}
else{
if(strcmp(p_string,"0.0")==0 || strcmp(p_string,"0")==0 || strcmp(p_string,"0.")==0){
return result;
}
else{
return C_WRONG;
}
}
}