该计划:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char *a = (char *)malloc(5);
printf("say hello\n");
scanf("%s", a);
if(!strcmp(a,"hello"))
printf("\n hello");
else
printf("\n say hello");
free(a);
system("PAUSE");
return 0;
}
该程序使用代码块编写,使用c编译并在Windows 7中运行。
可能导致此错误的原因(Program received signal SIGTRAP, Trace/breakpoint trap.
)?
提前致谢。