file * question

Sep 17, 2009 at 7:15pm
can fprintf be used to write to a file that is opened with this syntax?

ofstream file1("data.txt");

or do they have to be used as FILE * file1,?
Sep 17, 2009 at 7:34pm
No, but you can use sprintf() to write formatted string into a char[], which you can write into a ofstream object.
Topic archived. No new replies allowed.