• 博客(0)
  • 资源 (1)

空空如也

c语言名题精选百则技巧篇

这是部很好C语言自学练习的好书 #include <limits.h> /* for INT_MAX and INT_MIN */ #include <ctype.h> /* for isdigit() */ #define OVERFLOW 1 #define UNDERFLOW -1 #define NO_ERROR 0 int x_atoi(char s[], int *result) { int digit_value; /* value of the scaned dig */ int i; *result = 0; for (i = 0; isdigit(s[i]); i++) /* overflow test */ if (*result <= (INT_MAX - (digit_value=s[i]-'0'))/10) *result = 10 * *result + digit_value; else return OVERFLOW; /* returns OVERFLOW */ return NO_ERROR;

2010-06-07

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除