Posted by MindBreaker at 2:38 PM
Read our previous post
Create a file "Test.txt" and enter some text message into it.
Source code
#include <iostream>
#include <fstream>
using namespace std;
void
main()
{
char
input[10];
ofstream myfile;
myfile.open("test.txt");
cout<<"Type
your message here"<<endl;
cin.getline(input,10);
myfile<<"The
message is "<<input<<endl;
myfile.close();
}
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.