LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
楼主: mantou

About gcc in Mandrake 9.0!!!

[复制链接]
发表于 2002-11-3 15:09:27 | 显示全部楼层
this is not big problem,it's suggested to use the truth value!!!
我说的返回值不是指这里,是指前面的 malloc 调用。这个地方是你 segfault 的根源,你仔细看了这说的是哪一行了吗?

关于函数声明,我的建议是永远在文件开始声明你所有的函数(除了 main),包括返回类型,函数名和参数类型。

其余的问题都是最基本的 C 问题,我想说的就是去找一本好的 C 语言教材来重头学。你用的书也许是不错的数据结构教材,但作为学习 C 的来源真的是非常非常不合适。
 楼主| 发表于 2002-11-4 12:40:21 | 显示全部楼层
i have found that what is the point of the problem.

in the FUCTION insert :

struct student * insert(struct student *head,struct student *stud)
  { struct student *p0,*p1,*p2;
    p1=head;
    p0=stud;
   if(head =0)

the  value to the head should be like :   head == 0
the it's ok!

Is there somebody can explain the difference between = and ==???
发表于 2002-11-4 17:15:02 | 显示全部楼层
刚看你的帖子,没仔细看你的程序,所以就说一点,既然用if(),自然要用比较符==,=是赋值符号,不是用来比较是否head等于0,所以两者性质不一样。
 楼主| 发表于 2002-11-4 17:45:05 | 显示全部楼层
thank you Linuxfish   ,love you!!

i think that if there is the document about the Chinese help to man of GCC !

i think that it is will be more helpful for us!

with the help of 高原之狼,i have learnd that how to analysis the C code i practis is the standard C,ANSI C!
高原之狼 is right ,when we learn the C,should be careful,that will be helpful!

After two days,i have got a little improve!!

so ,i want more details !!!
That will be wonderful!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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