cgcccodeblocksgetline

Where/how to get the "getline" function if it is missing from stdio.h?


I'm writing a program in C using Code::Blocks 13.12 on Windows 8 (the C compiler is mingw32-gcc). I would like to use the "getline" function but it seems to be missing from the stdio.h. Is there any way to get it except for writing own implementation?


Solution

  • getline is a POSIX function, and Windows isn't POSIX, so it doesn't have some POSIX C functions available.

    You'll need to roll your own. Or use one that has already been written.