【发布时间】:2013-09-16 19:58:21
【问题描述】:
代码:
int main()
{
char *name=NULL;
int n;
printf("\nenter the string\n");
scanf("%s",name);
n=strlen(name);
printf("%d",n);
return 0;
}
我遇到分段错误。代码有什么问题?我已经收录了stdio.h、stdlib.h、string.h。
【问题讨论】:
-
解决了,谢谢 :)
-
I have included stdio.h, stdlib.h, string.h--你应该阅读:What is segmentation fault
标签: c segmentation-fault