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

后端 未结 7 452
没有蜡笔的小新
没有蜡笔的小新 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:21

    This is because the stdio.h have a getline() function.

    So a simple thing to make this work would be to rename your function to my_getline()

    Both getline() and getdelim() were originally GNU extensions. They were standardized in POSIX.1-2008.

提交回复
热议问题