请问为什么在Linux下编译执行时,出现 段错误 ?
#include<stdio.h>intmain(intargc,char*argv[]){char*s="ChinaBeijing2008OlympicGames";c...
#include <stdio.h>
int main(int argc, char *argv[])
{ char *s="China Beijing 2008 Olympic Games";
char *p;
p=s;
while((*p)!='')
p++;
*p='\0';
printf("%s\n",s);
printf("%s\n",++p);
} 展开
int main(int argc, char *argv[])
{ char *s="China Beijing 2008 Olympic Games";
char *p;
p=s;
while((*p)!='')
p++;
*p='\0';
printf("%s\n",s);
printf("%s\n",++p);
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询