delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/25/15:16:45

From: "jan malina" <jan.malina@{NOSPAM}ping.be>
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

Here is a better C++ vers.
And add #include <stdio.h> 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<F]V960 AT 8GD@2F%N($UA;&EN82 J+PT*
M#0HC:6YC;'5D92 \:6]S=')E86TN:#X-"B-I;F-L=61E(#QF<W1R96%M+F@^
M#0HC:6YC;'5D92 \<W1D;&EB+F@^#0H-"F9S=')E86T@*F9I8VAI97([#0IC
M:&%R('1E>'1E6S AT P73L-"G-H;W)T(&EN="!F:6QE3TL[("\O($YE961S(&QE
M<W,@;65M;W)Y#0H-"G9O:60@;6%I;BAV;VED*0T*>PT*(" @9FEL94]+/3 [
M#0H@("!C;W5T(#P\(")<;D]P96YI;F<@9FEL92XB.PT*(" @9FEC:&EE<BYO
M<&5N*")T97-T+FEN:2(L(&EO<SHZ;F]C<F5A=&4I.PT*(" @:68@*"%F:6-H
M:65R*0T*(" @>PT*(" @(" @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<BD[#0H@(" @("!I9B H=&5X=&5;
M,%T]/2=;)RD-"B @(" @("!I9B H=&5X=&5;,5T]/2=D)RD-"B @(" @(" @
M:68@*'1E>'1E6S)=/3TG<B<I#0H@(" @(" @("!I9B H=&5X=&5;,UT]/2=I
M)RD-"B @(" @(" @("!I9B H=&5X=&5;-%T]/2=V)RD-"B @(" @(" @(" @
M:68@*'1E>'1E6S5=/3TG92<I#0H@(" @(" @(" @("!I9B H=&5X=&5;-ET]
M/2=R)RD-"B @(" @(" @(" @("!I9B H=&5X=&5;-UT]/2=S)RD-"B @(" @
M(" @(" @(" @:68@*'1E>'1E6SA=/3TG,R<I#0H@(" @(" @(" @(" @("!I
M9B H=&5X=&5;.5T]/2<R)RD-"B @(" @(" @(" @(" @("!I9B H=&5X=&5;
M,3!=/2==)RD-"B @(" @(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @
M(" @9G!R:6YT9BAF:6-H:65R+")<;E1H:7,@:7,@82!T97-T7&XB*3L-"B @
M(" @(" @(" @(" @(" @("!C;W5T(#P\(")<;E-T<FEN9R!A9&1E9"XB.PT*
M(" @(" @(" @(" @(" @(" @(&9I8VAI97(N8VQO<V4H*3L-"B @(" @(" @
M(" @(" @(" @("!C;W5T(#P\(")<;D9I;&4 AT 8VQO<V5D+EQN(CL-"B @(" @
M(" @(" @(" @(" @("!F:6QE3TL],3L-"B @(" @(" @(" @(" @("!]#0H@
(("!]#0I]#0H`
`
end

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019