Ⅰ c語言計算字元串的長度(用指針)
#include<cstdio>
int main()
{
char s[20];
char*p;
printf("please input a string(less than 20 character): ");
//scanf("%s",s);不能讀入空格
gets(s);
p=s;
while(*p!='
Ⅰ c語言計算字元串的長度(用指針)
#include<cstdio>
int main()
{
char s[20];
char*p;
printf("please input a string(less than 20 character): ");
//scanf("%s",s);不能讀入空格
gets(s);
p=s;
while(*p!='