Skip to main content

C++ program, which initializes a string variable and outputs the string to the disk file.

 

#include<fstream.h>
void main()
{
	ofstream fout;
	fout.open("out.txt");
	char str[300]="Time is C++ File Handling";
	 
	fout<<str;
	fout.close();
}
 

Comments