Questions tagged [eof]

End of file (commonly abbreviated EOF) is a condition in a computer operating system where no more data can be read from a data source.

From Wikipedia:

End of file (commonly abbreviated EOF) is a condition in a computer operating system where no more data can be read from a data source. The data source is usually called a file or stream.

EOF is also a macro defined in the <stdio.h> header of the C standard library. This macro:

expands to an integer constant expression, with type int and a negative value, that is returned by several functions to indicate end-of-file, that is, no more input from a stream;

For more information:

1831 questions
0
votes
3 answers

Filling an array from a .txt file VB 6.0

I'm lost, I try to fill arrays and receive a type mismatch I'm trying to fill 4 arrays from one file There is 500 lines in the text document each holding 4 different types of data separated by "," The .txt file format example ---> pear, apple,…
Sigh
  • 133
  • 8
0
votes
2 answers

EOF / Failed to load error when calling PHP file with AJAX

Apparently my POST requests are being cancelled? http://puu.sh/d73LC/c6062c8c07.png and also, mysqli_result object has all null values when i query the database with a select query: object(mysqli_result)[2] public 'current_field' => null public…
0
votes
1 answer

Hangman Python Error

I keep getting an EOF error when I try to run the code. I was wondering how I can fix this? Thanks in advance.When I try to remove if_name_ the program does not have any syntax errors but it does not run. Here is a link that shows the error:…
DatOneGuy
  • 7
  • 3
0
votes
1 answer

Echo An Array inside a EOF statement

I'm trying to send an HTML email receipt from a shopping cart purchase but I don't get how to echo the session array within the EOF area. php doesn't seem to want to execute here. Thoughts? //begin of HTML message $message = <<
0
votes
0 answers

Insert an endline character at the end of file in shell script

I am trying to check if a file has already EOF character is so do nothing, if not then add a new line characer to the end of the file in shell script. currently i am using : sed -i -e '$a\' file getting error message : sed: Not a recognized flag:…
Rinku
  • 55
  • 1
  • 6
0
votes
3 answers

Boolean expression with EOF not working

I tried to write a pice of code that lets the user enter an infinite (limited only by memory) amount of strings where each string can be up to 298 chars long (array of 298 with one '\n' and '\0' in the end). The end signal should be EOF (Strg+Z on…
BStadlbauer
  • 1,287
  • 6
  • 18
0
votes
1 answer

While loop using Scanner method hasNext() fails to loop, exits unexpectedly

So I've been working on an assignment for school. It says to make a program that does the following: 1. Prompt user for input 2. Take input from user three times, store as floats 3. Pass variables to method minimum() which uses Math.min() to…
NiaKitty
  • 93
  • 4
0
votes
0 answers

Java InputStream End of File for Serial Connection

I'm struggling with EOF on a serial port and using a Java InputStream. My serial device sends continuously 16 bytes with a frequency of 100Hz. My receive routine is similar to this private static final int MESSAGE_SIZE = 20; public byte[] read()…
z3ky
  • 1
  • 1
0
votes
1 answer

Providing User Feedback via Error Code on EOF (CTRL+D) character in C++ Program

I know there are similar questions about EOF and CTRL+D, but I have a more specific question. The way I understand it, CTRL+D signals the end of STDIN and is handled by the computer and not the running application. However, I need to provide…
mallux
  • 77
  • 1
  • 2
  • 6
0
votes
3 answers

Adding scanf and EOF to program

#include #include int main() { char string[100]; int c = 0, count[26] = {0}; int accum = 0; printf("Enter a string\n"); gets(string); while ( string[c] != '\0' ) { if ( string[c] >= 'a' &&…
user3880587
  • 69
  • 2
  • 12
0
votes
3 answers

getchar() function and EOF

I was practicing C program that i read from The C ANSI Programming Language Second Edition I learn about getchar() function.And the book say that getchar() read the character from stdin until newline character or EOF has been reached.And in the book…
harianja
  • 63
  • 2
  • 8
0
votes
4 answers

Add n Integers to an non fixed Array

I've been looking for a solution quite a while now, but did not manage to find anything. I need a program which takes the users input (a random amount of integers) until EOF, sums them up and gives me back the average. I tried it using an array but…
smnk
  • 471
  • 1
  • 6
  • 25
0
votes
1 answer

end of file infinite while-loop

I have this program I'm writing to read and calculate principle and interest from a file and printing a table to an output file. Everything works fine except I can't figure out why I'm stuck in the while loop in the main. It prints all of my data…
Maggie K
  • 31
  • 8
0
votes
1 answer

Error when reading file using fscanf

I still can't understand why this printf is printing many 0 and the i++ is having no effect int i=0; char datos[5]=""; while((fscanf(entry_file,"%5s",datos))==1) { //Buffer para @ char x; if((strcmp(datos,"DATOS"))==0) { …
Juan Diego
  • 1
  • 1
  • 1
0
votes
2 answers

unix shell script to check for EOF

I wish to take names of two files as command line arguments in bash shell script and then for each word (words are comma separated and the file has more than one line) in the first file I need to count its occurrence in the second file. I wrote a…
Abhinav Arya
  • 225
  • 3
  • 9
1 2 3
99
100