In the following program it says that there is a conflict between my getline and the getline in stdio.h. I understand what it's saying because stdio.h has it's own getline function. What's confusing me is that this is the program that my programming book (The C Programming Language) is giving me to compile. Is there a way around this?

Recommended Answers

All 3 Replies

getline isn't a standard function, so your book is correct. The problem is your compiler supports that function as an extension, so the easiest approach would be to change the name of the function in your code to something else.

My compiler supports that function as an extension. What does that mean? I'm using gcc.

Compiler vendors are allowed to add onto the standard C libraries. We sometimes refer to those additions as an extension.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.