[问题] 一样的码结果不一样

楼主: a75088285 (活在回忆中的回忆)   2019-03-11 16:26:28
开发平台(Platform): (Ex: Win10, Linux, ...)
VMware/fc8_fedora
编译器(Ex: GCC, clang, VC++...)+目标环境(跟开发平台不同的话需列出)
gcc
问题(Question):
两段程式码对照相同但是卡在scanf出现内存区段错误
喂入的资料(Input):
#include <stdio.h>
int main()
{
int x,y,z,x1,y1,z1;
x=2;y=1,z=3;
x1=x;y1=y;z1=z;
x=z1;y=x1;z=z1+y1;
printf("%d %d %d\n",x1,y1,z1);
printf("%d %d %d\n",x,y,z);
return 0;
}
#include <stdio.h>
int main (void)
{
int a;//
作者: jerryh001   2019-03-11 16:31:00
scanf要&a
作者: CMJ0121 (请多指教!!)   2019-03-11 16:32:00
查 man : the next pointer must be a pointer to int
作者: IhateOGC (我讨厌)   2019-03-11 16:37:00
楼主: a75088285 (活在回忆中的回忆)   2019-03-11 17:05:00
感谢囧,东改西改结果是这个没改…

Links booklink

Contact Us: admin [ a t ] ucptt.com