标题:我写了一个程序 在VC6上能执行的 但在ubuntu上却显示段错误
取消只看楼主
summerxia
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2012-3-8
结帖率:0
已结贴  问题点数:30 回复次数:0 
我写了一个程序 在VC6上能执行的 但在ubuntu上却显示段错误
#include<stdio.h>
#include<string.h>
void main()
{
    char *p[9]={"em","cuz","gratz","i","nah","pos","sez","tanx","wuz"};
    char *q[9]={"them","because","grateful","I","no","supposed","said","thanks","was"};
    char s[]="nah i sez tanx cuz i wuz pos to not cuz i wuz gratz";
    char a[10];   
    int i,j,m=0;   
    while(1)
        {
       for(j=m,i=0;s[j]!=' ';j++,i++)
          a[i]=s[j];
          a[i]='\0';
          m=j+1;
       for(i=0;i<9;i++)
       if(strcmp(a,p[i])==0)
         printf("%s ",q[i]);
        }
} 就这么点分了  求帮忙下哈 拜托了
搜索更多相关主题的帖子: void because include ubuntu 
2012-03-08 16:18



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




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

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