房天下问答 >业主生活>其他> 问题详情

C问题,请问在函数foo中有什么错误,怎样修改才可解决错误?前提是不可修改init_bar。

/* init_bar takes a pointer to a struct bar and initializes its fields */ extern void init_bar(struct bar *b);int foo() { struct bar *fb;init_bar(fb);/* Do some... 展开
h564335|2010-12-07 04:01

其他答案

小小生活网

struct bar *fb;这个是声明,不是定义啊。空指针,传到函数里,稍微不注意就出错了。
2010-12-07 05:04
来自北京市

免责声明:问答内容均来源于互联网用户,房天下对其内容不负责任,如有版权或其他问题可以联系房天下进行删除。

关于我们网站合作联系我们招聘信息房天下家族网站地图意见反馈手机房天下开放平台服务声明加盟房天下
Copyright © 北京搜房科技发展有限公司
Beijing SouFun Science&Technology Development Co.,Ltd 版权所有
违法信息举报邮箱:jubao@fang.com
返回顶部
意见反馈