atoi实现
摘要:
atoi实现收藏1int atoi(const char *s){ char *p = s; char c; int i = 0; while(c=*p++) { if(c>='0' && c<='9') { i = i*10 + (c-'0'); } else return -1; //Invalid string } return i;}2#include <iostream>#include <string>#include <algorithm>using namespace 阅读全文
posted @ 2011-05-25 14:22 kyleada 阅读(10260) 评论(0) 推荐(0) 编辑