Greetings.
I'm also a beginner too, but I found some handy functions in C++.
These are FileOpen, FileCreate, etc. I think if you only want to read from a text file into a string you should use something like this.
Code:
int iFileHandle;
try { iFileHandle = FileOpen(filename, fmOpenRead);
}
catch(...)
{ Showmessage("Error");
goto end; //weird huh ? :)
}
iFileLength=FileSeek(iFileHandle,0,2);
FileSeek(iFileHandle,0,0); //go to the beginning of the file
buffer=new char[iFileLength];
FileRead(iFileHandle,buffer,iFileLength); //reads the file onto the buffer
It is like this. The buffer has to be a specific type (I don't remember it just now), I think void *char, or something like this, but from the buffer you can put your stream into a String one by one in a for cycle.
I do it this way, and it works fine. However in the recent past I have the problem that it reads an extra " ' " character to the end of the buffer. I don't know why it does this, but I'm on solving this little piece of problem.
Good luck!
Han