鱼C论坛

 找回密码
 立即注册
查看: 2736|回复: 2

问题在哪里

[复制链接]
发表于 2011-8-17 23:20:26 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
#include<stdio.h>
struct student
{
long num;
float score;
struct student *next;

};
void main()
{
struct student a,b,c,*head;
a.num =10101;
a.score = 89.5;
b.num = 10103;
b.score = 90;
c.num = 10107;
c.socre = 85;

head = &a;
a.next = &b;
b.next = &c;
c.next = NULL;

do
{
  printf("%ld %5.1f\n",head->num,head->score);
  head = head->next;
  
}while(head);//想当于head != 0;或者head != NULL;


}

这个程序在编译时出现问题,但小弟不知道问题所在请指教!
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
发表于 2011-8-17 23:39:29 | 显示全部楼层
你不会排错么,只有一个语法错,你把c.score = 85;打成c.socre = 85;了
修改后我运行正确
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
发表于 2011-8-18 09:30:30 | 显示全部楼层
X杰。你不晓得单步调试一下啊。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-3-29 16:50

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表