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.

Removing trailing newline character from fgets() input

I am trying to get some data from the user and send it to another function in gcc. The code …

c string gcc newline fgets
Read each line of txt file to new array element

I am trying to read every line of a text file into an array and have each line in a …

php arrays text-files fgets
How to read from stdin with fgets()?

I've written the following code to read a line from a terminal window, the problem is the code gets stuck …

c stdin fgets
Why is the gets function so dangerous that it should not be used?

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

c fgets buffer-overflow gets
C - scanf() vs gets() vs fgets()

I've been doing a fairly easy program of converting a string of Characters (assuming numbers are entered) to an Integer. …

c scanf fgets gets
Reading from file using fgets

I am reading from file of format 1 32 43 23 32 43 123 43 54 243 123 2222 2 Here is my code snippet. string[100]; while(!feof(fp)) fgets(string,100,fp) Now, …

c fgets file-read
fgets to read line by line in files

I understand that fgets reads until EOF or a newline. I wrote a sample code to read lines from a …

c file-io fgets
Reaching EOF with fgets

I'm writing a function that perform some authentications actions. I have a file with all the user_id:password:flag …

c unix eof fgets
Fscanf or Fgets? Reading a file line after line

i have to write a program in C to read a file containing several line of text, each line contains …

c fgets scanf
Difference between scanf() and fgets()

I want to know what is the difference between fgets() and scanf(). I am using C as my platform.

c scanf fgets