lkml.org 
[lkml]   [1997]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
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    [W:0.043 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site