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 fgets() a specific line from a file in C?

So, I'm trying to find a way to fgets() a specific line in a text file in C, to copy …

c filestream fgets
How do I eliminate line break from fgets function in PHP?

I am attempting to make a gallery that calls the image names from a flat file database using the PHP …

php javascript html fgets
Difference between read() and fgets() in C

I want to read from a stdin stream. Is there any difference in using read() or fgets() to read from …

c fgets
Safe Alternative to gets

When I try to compile C code that uses the gets() function with GCC, I get this warning: (.text+0x34): …

c++ c fgets gets
fgets doesn't work after scanf

#include <stdio.h> #include <string.h> #include <ctype.h> void delspace(char *str); int …

c scanf fgets
C: Reading a text file (with variable-length lines) line-by-line using fread()/fgets() instead of fgetc() (block I/O vs. character I/O)

Is there a getline function that uses fread (block I/O) instead of fgetc (character I/O)? There's a performance …

c file-io fgets fread
fgets and dealing with CTRL+D input

I am grabbing some standard input from the user and if the user presses CTRL+D, I want to display …

c linux fgets ctrl
Clear input buffer after fgets() in C

#include <stdio.h> int main() { char name[10]; for(int i=0;i<=10;i++) { printf("Who are you? "); if(…

c inputstream fgets fflush
Using fgets() with char* type

I have a simple question about using fgets() with char* string. .... char *temp; FILE fp=fopen("test.txt", "r"); fgets(…

c string char fgets
Search for a word in file line by line in C programming

I am trying to write code to search for a word in a file line by line and print the …

c file search fgets strstr