首页 热点资讯 义务教育 高等教育 出国留学 考研考公

重定义函数库出现问题,怎么解决?

发布网友

我来回答

1个回答

热心网友

重定义的函数参数和原参数不符合,所以报错,正确重定义格式如下:
int fputc(int ch, FILE *f)
{
.....//数据处理过程
return ch;
}
其函数在stdio.h里定义原型
extern _ARMABI int fputc(int /*c*/, FILE * /*stream*/) __attribute__((__nonnull__(2)));
/*
* writes the character specified by c (converted to an unsigned char) to
* the output stream pointed to by stream, at the position indicated by the
* asociated file position indicator (if defined), and advances the
* indicator appropriately. If the file position indicator is not defined,
* the character is appended to the output stream.
* Returns: the character written. If a write error occurs, the error
* indicator is set and fputc returns EOF.
*/

手打不易,望及时采纳,谢谢

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com