From: "jan malina" Newsgroups: comp.os.msdos.djgpp Subject: Re: Problem writing in a file... Date: Mon, 25 May 1998 19:25:56 +0200 Organization: EUnet Belgium, Leuven, Belgium Lines: 62 Message-ID: <6kc9lq$ifg$1@news3.Belgium.EU.net> References: <6jv6lo$73e$1 AT news3 DOT isdnet DOT net> NNTP-Posting-Host: dialup052.gent.eunet.be To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Here is a better C++ vers. And add #include else it don't work :-(; Jan Malina 8-) JCx heeft geschreven in bericht <6jv6lo$73e$1 AT news3 DOT isdnet DOT net>... > Hi there ! > >I just spent two hours trying to code -without success- the following thing: >I open a text file, then look for a specific string in this file (with >fgets) and then, when I find this string, my program is supposed to add >another string just after the one it found (with fprintf). The problem is: >the program duplicates everything that stands after the line found, and then >adds the line I looked for+the line I wanted to add at the end of the file ! > > To say it clearly: > >It opens system.ini : working >It looks for [drivers32] : working >I *should* write a string just after this line : bug > > Could anyone help me ? > Source included. > > Thanks, JCx. > jicehix AT worldnet DOT fr > > > begin 666 addv.cc M+RH AT 861D=BYC8R J+PT*+RH AT 26UP'1E6S AT P73L-"G-H;W)T(&EN="!F:6QE3TL[("\O($YE961S(&QE MPT*(" @9FEL94]+/3 [ M#0H@("!C;W5T(#P\(")<;D]P96YI;F<@9FEL92XB.PT*(" @9FEC:&EEPT*(" @(" @8V]U=" \/" B7&Y&:6QE(&YO="!F;W5N9" Z M*%QN(CL-"B @(" @(&5X:70H,2D[#0H@("!]#0H@("!C;W5T(#P\(")<;D9I M;&4@;W!E;F5D+B([#0H@("!W:&EL92 H(69I;&5/2RD-"B @('L-"B @(" @ M(&-I;BYG970H=&5X=&4L,3(L9FEC:&EE'1E6S)=/3TG'1E6S5=/3TG92'1E6SA=/3TG,R