"Adjuto Vasconcelos" <[EMAIL PROTECTED]> wrote:
> I am trying to write a txt file on the Hard disk.
>
> I use this program:
>
> FILE * pFile;
> pFile = fopen ("myfile.txt" , "w");

You should check for a null pointer return.

> fprintf (pFile, "%s This goes in one line \rThis goes on the other
> line");

This is an invalid line. You specify a %s, but you supply no
corresponding argument.

But in answer to your question, \n is the newline character for text
files.

  fprintf(pFile, "This goes in one line\nThis another\n");

Note that the last line of a text file should also have a newline
character, otherwise the last line may not be output on some systems.

> fclose (pFile);

--
Peter





To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.


Yahoo! Groups Sponsor
ADVERTISEMENT
click here
Web Bug from http://us.adserver.yahoo.com/l?M=298184.5639630.6699735.3001176/D=groups/S=:HM/A=2434971/rand=347280845


Yahoo! Groups Links

Reply via email to