标题:请过路的人帮我修改下关于指针的程序
取消只看楼主
pl123586
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2016-10-13
结帖率:0
 问题点数:0 回复次数:0 
请过路的人帮我修改下关于指针的程序
#include <stdio.h>
#include <stdlib.h>
#define len 80
int main(){
    char string[len],*pstr;
    int t=0;
   
    pstr=string;
    printf("Input a string:");
    gets(pstr);
      
    while(*pstr++!='\0')
      if(*pstr==' '){
          t++;
          continue;
          printf("%d",t);}
      else
       printf("\n");
     
    if(*pstr=='\0')
      printf("NO space in '%s'.\n,string");
    system("PAUSE");
    return 0;
}
我不知道错在哪,如果可以请帮我指出
题目:用指针方法实现:字符串指针示例:输入一串字符,检测输入的字符串中是否有空格,计算其中空格的个数。
搜索更多相关主题的帖子: continue include system return 字符串 
2016-12-22 14:26



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-472762-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.205197 second(s), 10 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved