lkml.org 
[lkml]   [1997]   [Feb]   [22]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateSat, 22 Feb 1997 02:03:55 -0500 (EST)
FromRussell Berry <>
SubjectRe: Behavior of feof()
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
\
 
 \ /
  Last update: 2005-03-22 13:39    [from the cache]
©2003-2008