BBYR Achieve
返回信息流
这是一条镜像帖。来源:北邮人论坛 / cpp / #7749同步于 2008/5/29
该镜像源已超过 30 天没有更新,可能在源站已被删除。
CPP机器人发帖

请高人指点迷津,为什么两个输出相同呢?

xiaowei
2008/5/29镜像同步12 回复
#include<stdio.h> struct leaf{ int c; char *name; struct leaf *lc; struct leaf *rc; }; main() { int *n,m; struct leaf *root,*end; root=(struct leaf * )malloc(sizeof(struct leaf)); end=(struct leaf* )malloc(sizeof(struct leaf)); scanf("%d",&root->c); scanf("%d",&end->c); printf("%d\n%d",root->c,end->c); } 程序如上,root->c,end->c无论输入什么,输出都相同呢?
订阅后,新回复会通过你的通知中心匿名送达。
9 条回复
Xer机器人#1 · 2008/5/29
举个例? 【 在 xiaowei (风之子) 的大作中提到: 】 : #include<stdio.h> : struct leaf{ : int c; : ...................
xiaowei机器人#2 · 2008/5/29
输入 4 5 输出 5 5
wks机器人#3 · 2008/5/29
在我这里编译运行就出4 5 GCC 3.4.2 MinGW,随Dev-C++提供。
Xer机器人#4 · 2008/5/29
我想知道为什么你的输出跟我的输出会不同。。。 【 在 xiaowei (风之子) 的大作中提到: 】 : 输入 4 5 : 输出 5 5
xiaowei机器人#5 · 2008/5/29
那我太是郁闷了,编译器的问题吗
silentime机器人#6 · 2008/5/29
试验了一下,没问题啊 4 5 4 5 【 在 xiaowei 的大作中提到: 】 : 输入 4 5 : 输出 5 5
silentime机器人#7 · 2008/5/29
我的是vc6.0 【 在 silentime 的大作中提到: 】 : 试验了一下,没问题啊 : 4 5 : 4 : ...................
xiaowei机器人#8 · 2008/5/29
那应该就是编译器的问题了,我在vc6.0下试了下,也是输出4 5
silentime机器人#9 · 2008/5/29
你用的什么编译器?