标签:转换 pre lease string std class clu fun Nging
#include<stdio.h> #include<string.h> long fun(char *s) { long m=0; int i,n=strlen(s); for(i=0;i<n;i++) m=m*10+(*(s+i)-‘0‘); //从数的最高位开始赋值给m return m; } void main() { char s[10]; printf("please input a num_string:"); gets(s); printf("after changing the string is:%d\n",fun(s)); }
标签:转换 pre lease string std class clu fun Nging
原文地址:https://www.cnblogs.com/-slz-2/p/11275547.html