Chinaunix首页 | 论坛 | 博客

分类: C/C++

2012-02-16 18:47:49

代码:
buffers = calloc (req.count, sizeof (*buffers));

错误:
error: request for member '
length' in 'buffers', which is of non-class type 'buffer*'

原因:
大多数编译器,要求malloc时必须强制类型转换

修改后:
buffers = (struct buffer*)calloc (req.count, sizeof (*buffers));


阅读(2210) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~