Reading from a .txt file.

A program I'm making takes a username and password.

The username is the name of the .txt file and the password is kept in the file.

I was wondering how I could get an input from the user and check whether or not it was the same in the file.
http://cplusplus.com/reference/iostream/fstream/

Reply back if you have troubles. But only after you've read what's at the link.
I read the link, but nothing (that I can see) reads data from the file.
The f before stream stands for file. You can use fstreams to read data from or write to files. So... what's your problem?
Say the password, 'hello', is in the file, how could I get the program to read 'hello' from the file and hold it to a variable?
I can't find anything on the fstream that does the job.

Sorry if I'm being a pain, I just know that something must do it.
Last edited on
Topic archived. No new replies allowed.