From: "Florian X" Newsgroups: comp.os.msdos.djgpp References: <38b17e92$0$82782 AT SSP1NO17 DOT highway DOT telekom DOT at> <88rvjt$gv8$1 AT spruce DOT ukc DOT ac DOT uk> Subject: Re: append to a file Date: Mon, 21 Feb 2000 19:24:40 +0100 X-Newsreader: Microsoft Outlook Express 4.71.1712.3 X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 Lines: 23 Message-ID: <38b18285$0$81870@SSP1NO17.highway.telekom.at> NNTP-Posting-Host: 212.183.97.89 X-Trace: newsreader.vienna.highway.telekom.at 951157381 81870 212.183.97.89 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Chris Jones schrieb in Nachricht <88rvjt$gv8$1 AT spruce DOT ukc DOT ac DOT uk>... >> I want to append 128Byte on a file, so I open with >> >> char string[126]; >> FILE *f = fopen(file, "a"); >> fprintf(f,"TAG%-125s", string); >> fclose(f); >> >> Why doesn't it write anything to file? > >Perhaps you should put something in the string - even just >char string[126] = " "; >because an uninitalized string could screw up printf. Yes, I know, I wrote this in my program. But this isn't that problem. I think it is a problem with fopen(); and the second parameter. Thanks, Florian X