Home
Blogs
Questions
Jobs
Monetize

Home

About Us

Blogs

Questions

Jobs

Monetize

Post Job

banner

Questions about fgetc

Read more about fgetc

python (12.9k questions)

javascript (9.2k questions)

reactjs (4.7k questions)

java (4.2k questions)

java (4.2k questions)

c# (3.5k questions)

c# (3.5k questions)

html (3.3k questions)

Questions - fgetc

fgetc vs getline or fgets - which is most flexible

I am reading data from a regular file and I was wondering which would allow for the most flexibility. I have found that both fgets and getline both read in a line (one with a maximum number of charact...
test-img

tintins7a6164

c

file-io

fgets

getline

fgetc

Votes: 0

Answers: 2

Latest Answer

The three functions you mention do different things: fgetc() reads a single character from a FILE * descriptor, it buffers input and so, you can process the file in a buffered way without having the ...
test-img

Luis Colorado

What are all the reasons `fgetc()` might return `EOF`?

Certainly fgetc() returns EOF when end-of-file or an input error occurs. Is that all and does that mean no more data is available? FILE *inf = ...; int ch; while ((ch = fgetc(inf)) != EOF) { ; } if ...
test-img

chux - Reinstate Monica

c

fgetc

Votes: 0

Answers: 3

Latest Answer

Is that all and does that mean no more data available? No, there are more ways for EOF. An EOF does not certainly mean no more data - it depends. The C library lists three cases where fgetc() retur...
test-img

chux - Reinstate Monica

Posts

Questions

Blogs

Jobs

The ultimate platform for coders and IT specialists

About

  • Company
  • Support

  • Platform

  • Terms & Conditions
  • Privacy statement
  • Cookie policy
  • Cookie option
  • OnlyCoders © 2025  |  All rights reserved