file * question

petergrwl (14)
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,?
R0mai (663)
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.