![]() | |||||||||||||
Messages in this thread |
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 | |||||||||||||