One posssible way to do it.
#include <fstream>
using namespace std;
int main()
{
//use for a series of numbers
int i=0;
// or use if you want 1 number
int j=1;
ofstream out ("yourfile.txt", ios::app);
//use j if you want to display 1 with dot (.)
out << i++ << "." << "Hello" << endl;
out << i++ << "." << "my" << endl;
out << i++ << "." << "name" << endl;
out << i++ << "." << "is" << endl;
out << i++ << "." << "Steven" << endl;
}
EDIT: Same code with string!
#include <fstream>
#include <string>
using namespace std;
int main()
{
string strText[] = {
"Hello",
"my",
"name",
"is",
"steven"
};
//use for a series of numbers
int i=0;
// or use if you want 1 number
int j=1;
ofstream out ("yourfile.txt", ios::app);
//use j if you want to display 1 with dot (.)
out << i++ << "." << strText[0] << endl;
out << i++ << "." << strText[1] << endl;
out << i++ << "." << strText[2] << endl;
out << i++ << "." << strText[3] << endl;
out << i++ << "." << strText[4] << endl;
}