Why is a 'conflicting type' error being thrown when I execute this program?

前端 未结 3 1198
心在旅途
心在旅途 2021-01-19 15:48

In K&R Chapter 1.9, I\'ve been experimenting with the program provided below. Particularly, what would happen if I removed certain decelerations of functions.

So

3条回答
  •  日久生厌
    2021-01-19 16:24

    Getline is actually defined in in the stdio.h header

    ssize_t getline(char **lineptr, size_t *n, FILE *stream); 
    

    hence deleting your own getline implementation will not throw an error. Instead, deleting your other function, will throw an error because no such function does exist in stdio.h but it's user-defined. By the way, in this case the problem you are facing can be simply resolved by deleting the function itself from the program.

提交回复
热议问题