Top "Fgets" questions

Anything related to C or C++ standard library functions `fgets` (C) or `std::fgets` (C++). These functions are used to read a sequence of characters from an input stream and to write it into a character buffer as a string.

How to clear input buffer after fgets overflow?

I'm facing a little problem with fgets when the input string exceeds its predefined limit. Taking the example below: for(…

c overflow fgets
C child read giving "resource temporarily unavailable"

So I have a file stream from a parent process to a child - and most of the time it …

c process fgets
How to read and overwrite text file in C?

I have a text file text.txt that reads (for simplicity purposes) this is line one this is line two …

c file pointers fgets overwrite
Read a line of input faster than fgets?

I'm writing a program where performance is quite important, but not critical. Currently I am reading in text from a …

c optimization file-io stdin fgets
Mimic Python's strip() function in C

I started on a little toy project in C lately and have been scratching my head over the best way …

python c string fgets
C fgets versus fgetc for reading line

I need to read a line of text (terminated by a newline) without making assumptions about the length. So I …

c io stdio fgets fgetc
Difference between fgets and gets

What is the difference between fgets() and gets()? I am trying break my loop when the user hits just "enter". …

c scanf fgets gets
Searching for specific words in a text file

HI guys havent been able to find how to search for specific words in a text file anywhere, so here …

c text-files fgets fputs
PHP character encoding hell reading csv file with fgets

I have a web site that receives a CSV file by FTP once a month. For years it was an …

php encoding fgets
carriage return by fgets

I am running the following code: #include<stdio.h> #include<string.h> #include<io.h&…

c string fgets carriage-return