J
Jobs'R'Us
Hello,
I have compiled the following for Linux Intel and Windows, and the
loop breaks correctly at EOF, but the same code for the StrongARM
processor does not break correctly (keeps going until max number is
reached). What gives? What am I doing wrong? I tried both getc and
fgetc, same result.
The code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* ... main begins... */
char c;
// loop until done or until we have 50000
while(wordnumber < 49999)
{
c = getc(file);
if(c == EOF)
{
break;
}
else
{
/* code keeps going */
Help will be greatly appreciated!
Kirst
I have compiled the following for Linux Intel and Windows, and the
loop breaks correctly at EOF, but the same code for the StrongARM
processor does not break correctly (keeps going until max number is
reached). What gives? What am I doing wrong? I tried both getc and
fgetc, same result.
The code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* ... main begins... */
char c;
// loop until done or until we have 50000
while(wordnumber < 49999)
{
c = getc(file);
if(c == EOF)
{
break;
}
else
{
/* code keeps going */
Help will be greatly appreciated!
Kirst