自己的第一个代码 include <stdio.h> int main() { char arr1[]={"hello"}; char arr2[]={'h','e','l','l','o','\0'}; int i; printf("%s\n",arr1); printf("%s\n",arr2); for(i=0;i<6;i++) printf("%5d ",arr1[i]); getchar(); getchar(); } 将字符转化为数字输出 int main() { int flag=0,i=0; long num=0; char str[]={"-1688"}; while(str[i]!='\0') { if(str[i]=='-') flag=1; else if(str[i]=='+') flag=0; else num=num*10+(str[i]-'0'); i++; } if(flag==1) num=-num; printf("由数字字符串转化成的整数是:%1d\n",num); getchar(); getchar(); return 0;