发布网友
共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.
*/
手打不易,望及时采纳,谢谢