yes i found a way...stupid me...hehe..ok the fstream class has a function called getline()
let me demonstrate..pretend i have a file name "test.txt" with the following stuff in it
Code:
cpp ninja rocks!
cpp ninja is cool!
with this code it will get the first line which is "cpp ninja rocks!" and stores it into name and outputs it
Code:
#include <iostream.h>
#include <fstream.h>
int main()
{
char* name = new char[50];
ifstream a_file("test.txt", ios::nocreate);
a_file.getline(name, 50, '\n');
cout << name;
return 0;
}
hope that helps