- This topic has 0 replies, 1 voice, and was last updated 19 years, 9 months ago by .
Viewing 0 reply threads
Viewing 0 reply threads
- The forum ‘C Programming’ is closed to new topics and replies.
Home › Forums › C Programming › Make a simple text file
Small program to show you how to create a text file.
1 2 3 4 5 6 7 8 9 10 11 12 13 | #include<iostream.h><br /> #include<fstream.h><br /> main(){<br /> ofstream out ("test.txt");<br /> if(!out){<br /> cout<<"Can not open";<br /> return 1;<br /> }<br /> out <<10<<" "<<23.<<"n";<br /> out<<"This is short file";<br /> out.close();<br /> return 0;<br /> } |