• Log in or sign up for an account here: https://www.sythe.org/login

need small c++ help please

Hey there :), what you will need to do is use an "ifstream" you will need to include the fstream

ifstream filestream;
filestream.open ("textfile.txt");

That will create an ifstream that will open the textfile.txt (note: file must be in the same folder obviously)

Then to read from it use:

Code:
while(!filestream.eof) //checks if the filestream has not reached its "eof" - end of file
        {
	        getline(infile,STRING); //gets a string from the file similar to a buffered reader in java
        }
	infile.close(); //always remember to close your any stream :)

I sell java and c++ help my thread is in my sig if you're interested.
 
Runescape Gamblingrunescape gambling
Back
Top