ok i just created this little program:
Code:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
char buffer[255], file[255], text[255];
cout << "Filename: ";
cin.getline( buffer , 255);
strcpy(file, buffer);
cout << "Text: ";
cin.getline( buffer,255);
strcpy(text, buffer);
system("pause");
ofstream oFile(file,ios::app);
if (! oFile)
{
cout << "Somethings wrong..." << endl;
return -1;
}
oFile << text << endl;
oFile.close();
return 0;
}
this program creates always a new line and inserts the char text, now i want to read and output just one of those lines, but i have no idea how i should do this
i thought about adding a sign at the end of each line to mark new lines, but i donnu how to find this mark again!
can anyone help?
Creatures