gcc编译程序崩溃了!

来源:互联网 发布:js图片轮播 类似卡片 编辑:程序博客网 时间:2024/04/28 11:09
 程序如下:
#include<stdio.h>

void escape(char *s,char *t)
{
    char *toend=s;
    while(toend!='/0') toend++;//to the end of source
    while(t!='/0')
    {
        switch(*t)
        {
            case '/t':
                s[toend++]='//';
                s[toend++]='t';
                t++;
                break;
            case '/n':
                s[toend++]='//';
                s[toend++]='n';
                t++;
                break;
            default:
                s[toend++]=*t;
                t++;
                break;
        }
    }
    s[oend]='/0';
}

int main(void)
{
    char s[]="abc";
    char t[]="a/tb";
    escape(s,t);
    printf("%s/n",s);
    return 0;
}


结果一gcc就报错

不能从先前的错误中恢复,退出
Preprocessed source stored into /tmp/ccv9Anwz.out file, please attach this to your bugreport.
原创粉丝点击