本文共 608 字,大约阅读时间需要 2 分钟。
#include#include #include char a[]="hello word" ;char c[]="h";char *b;int main(){ b=a; //指针指向a数组 int len=strlen(b);// int len1=sizeof(a); //sizeof函数判断时,算\n,共11个字符,sizeof b 判断的是指针长度 printf("The new string is:"); printf("%s\n",b); printf("%d\n",len);// printf("%d\n",len1); while(*b) { printf("_%c \n",*b);//break; b++; int x =strcmp(b,c); if(x!=0) printf("no \n"); else { printf("yes ! is here!!\n"); *b=*b++; } //printf("%d \n",x); } return 0;}
转载地址:http://gbtgf.baihongyu.com/