Why do I get a “conflicting types for getline” error when compiling the longest line example in chapter 1 of K&R2?

后端 未结 7 450
没有蜡笔的小新
没有蜡笔的小新 2020-12-04 17:09

Here is a program I\'m trying to run straight from section 1.9 of \"The C Programming Language\".

#include 
#define MAXLINE 1000

int getline(         


        
7条回答
  •  情歌与酒
    2020-12-04 17:16

    The is already a function called getline defined in the "stdio.h" file. Thus a conflict in prototypes! Rename your function to "my_getline" or some other name and all should be fine!

提交回复
热议问题