我写了一个程序 在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]);
}
} 就这么点分了 求帮忙下哈 拜托了