The `feof` function is available as part of the C Standard Library and checks whether the end of a stream has been reached. Usually, when it is used, the code using it is wrong.
Questions tagged [feof]
157 questions
-1
votes
1 answer
PHP feof() False as first argument
I ended up “resolving” someone else’s code issue since the site was down and we couldn’t get a hold of them, but I don’t use PHP and I think this is working, but not for the right reasons:
They have something like:
$file =…

GL2014
- 6,016
- 4
- 15
- 22
-2
votes
1 answer
How to Open a text file utilising VSCode
Run into an issue with some code i wrote where i want to open a txt file and then display the name and grades of the people in said text file. The code i am using is as follows
#include
#include
struct student
{
char…

ThePhycho
- 11
- 1
-2
votes
2 answers
What happens if you don't check feof in C?
During read/write operations is it absolutely necessary to check feof()?
The reason I ask is because I have a program that performs read/write ONCE, here is the code below:
while (1) {
data = read_file_data(file);
write_file_data(data,…

programme3219873
- 192
- 1
- 7
-2
votes
2 answers
Reading text from a file using fscanf()
guys i want to read the text from my file and assign every character to a single element of the array
char A[1000];
FILE * fpointer;
fpointer=fopen("text.txt","r");
i=0;
while(!feof(fpointer))
{
fscanf(fpointer,"%c",&A[i]);
…

hfsocio
- 1
- 1
- 4
-2
votes
1 answer
Warning with, fopen, feof and fgetcsv
I'm in trouble, I am failing to understand why this error is happening.
So when I only run this code,
function getClientProject($cliente)
{
$file = fopen("Projetos.csv","r");
$ArrayCount = 0;
$bool = false;
while(! feof($file))
…

user3161343
- 63
- 5
-3
votes
1 answer
file.exe has stopped working
I'm pretty new to programming with basic knowledge in C & C++. I've been trying to run a code on my .dat file that I am using for image analysis.
Basically this .dat file has x & y positions of clusters along with their radius. With this code I am…

user2470358
- 11
- 2
-4
votes
1 answer
error: expected ')' before '!' token
The code looks almost identical to a previous assignment, however it does not compile.
The problem appears to be before the while(feof!(in))
error: expected ')' before '!' token
Code:
#include
int main (void)
{
int…

Matthew Marinoff
- 11
- 2