【C语言】利用指针求字符串长度

#include
void main(){
	char str[256],*p;
	p=str;
	gets(p);
	while((*p)!='\0'){
		p++;
	}
	printf("%d",p-str);
	
}

你可能感兴趣的:(c语言,开发语言)