Top "Fgetc" questions

Anything related to C or C++ standard library functions `fgetc` (C) or `std::fgetc` (C++). These functions are used to read a single character from a stream.

Reading string by char till end of line C/C++

How to read a string one char at the time, and stop when you reach end of line? I'am using …

c++ c string file fgetc
getc() vs fgetc() - What are the major differences?

Everywhere I see "it is practically identical", or something similar... From The GNU C Programming Tutorial : There is another function …

c fgetc getc
How to read characters from a file until a space and store that as one string (c)?

I need to read all the information from a line in a file before a space and store it as …

c arrays string fgetc
How do i print escape characters as characters?

I'm trying to print escape characters as characters or strings using this code: while((c = fgetc(fp))!= EOF) { if(c == …

c fgetc ansi-escape
fgetc(stdin) in a loop is producing strange behaviour

I have this code while(1){ printf("hello world !\n"); fgetc(stdin); } when this runs and I enter a letter like …

c fgetc
Returning a string [char pointer] from a function

I am writing a program that returns a string from stdin, but i am getting warning that it returns an …

c string return fgetc
Reading word by word from text file in C

I am very new to C. I am trying to read the words from a file which contains lots of …

c char fopen fgetc file-read
fgetc stops when recognizing new line (\n)

I have this code: while( (cCurrent = fgetc(fp)) != EOF) { } The problem is, when it hits a new line it stops …

c file newline fgetc
Writing my own Cat function in C

Hi i don't know how to simulate my own Cat function in C, i know how it works when no …

c function eof cat fgetc
Can i use fgetc() or fputc() in a binary file?

I am creating an archive program in C, and i want it to save files i provide, list and extract …

c fwrite fread fgetc