Re: Behavior of feof()

Russell Berry (berrex@albany.net)
Sat, 22 Feb 1997 02:03:55 -0500 (EST)


On 22-Feb-97 David S. Miller wrote:
>
>Take away the + from the mode string for opening rgb.txt and
see what
>that does.

Okay, this did the same thing:

#include <stdio.h>

void main(){

int r,g,b,result;
char cname[80];

FILE *rgb,*color;

rgb=fopen("rgb.txt","r");
color=fopen("XColor.java","w+");
while(!feof(rgb)){
fscanf(rgb,"%d%d%d%s",&r,&g,&b,cname);
fprintf(color," ////////////////////\n");
fprintf(color," // The color %s\n",cname);
fprintf(color," ////////////////////\n\n");
fprintf(color," public final static Color %s = new
Color(%d, %d, %d);\n\n",cname,r,g,b);
}
fclose(rgb);
fclose(color);
}

_______________________________
Berrex Computer Solutions
Turnkey Solutions/Consulting
Software Development
http://www.albany.net/~berrex
berrex@albany.net