YoungEagle

代码人生

C++博客 联系 聚合 管理
  0 Posts :: 4 Stories :: 0 Comments :: 0 Trackbacks
 1void RemoveSpace(char* str)
 2{
 3    char* p;
 4    char* q;
 5    char  ch;
 6
 7    p = str;
 8    q = str;
 9
10    while (*p)
11    {
12        if (*!= ' ')
13        {
14            ch = *p;
15            *= ch;
16            p++;
17            q++;
18        }

19        else
20        {
21            p++;
22        }

23    }

24
25    *= '\0';
26
27}

28
29int _tmain(int argc, _TCHAR* argv[])
30{
31    char str[] = "abc d e f g   ";
32
33    RemoveSpace(str);
34
35    printf("%s", str);
36
37    getchar();
38
39    return 0;
40}
posted on 2011-05-06 22:33 LRJ 阅读(148) 评论(0)  编辑 收藏 引用 所属分类: C++

只有注册用户登录后才能发表评论。
网站导航:   博客园   博客园最新博文   博问   管理