Inputting text from a file

I have to write this program that is to store the name, address, id number, etc of a student. The data is supposed to be brought in through main and there will be multiple students. I'm not sure what commands I should use to bring it in. If someone could give me a relative idea on how to bring it in from the file and store it for the program to use I would appreciate it.

EDIT: This will make more sense. In the .txt file the info will be written like
Name
Last name
Address
etc.

I need to input that and use that for the appropriate number of students.
Last edited on
You will need:

1. a struct or class to hold each record
2. a container to hold many records of the type in 1. above
3. code to open the file
4. read each line from open file
5. validate the line read and ensure it is what was expected, if it is assign it to the correct member variable of class/struct
6. close file
7. display records read
...
Topic archived. No new replies allowed.