Message-ID: <20000502033204.98303.qmail@hotmail.com> X-Originating-IP: [165.91.71.145] From: "Sxott b." To: djgpp AT delorie DOT com Subject: reading text files Date: Tue, 02 May 2000 03:32:04 GMT Mime-Version: 1.0 Content-Type: text/plain; format=flowed Reply-To: djgpp AT delorie DOT com I want to read 2 values from a text file, modify them and write them back. I placed them alone on a line each so the file looked like this 12 45 that was all, but I couldn't figure out how, so I wrote the text file as a12 c45 that way I could search for a and take the number following, and likewise with c, but none of these things worked, is there a way to do this? how would I go about it thanks. if ((fp = fopen("c:\\text.txt","rt")) == NULL) { printf("Error opening file text.txt\n"); } if(write!=1) { //here is the place to read in added and counted //dos_read fread(added_int,size?,1,fp); these are wrong //fread(counted_int,size?,1,fp); for(i=0;(c=fgetc(fp))!=EOF&&i<1000;++i) data[i]=(char)c; for(c=0;c