I am trying to write a program with lists that stores student id's, names, resident status and credit hours. The program is supposed to accept input as long as the id# is not 0. The output is the list of students in the order they were enterd, the list of resident students, and the list of students with 12+ credit hours. I have the below that I have written. When I compile I get two errors. Also, what is the best way to make sure that the values are entered until id = 0? Right now, I have a break statement, but I think a while loop would be more efficient. However, I have never used a while loop and immediaitely after used a for loop. Is this the best way?
stulist.cpp: In function 'int main()':
stulist.cpp:85: error: invalid use of member (did you forget the '&' ?)
stulist.cpp:96: error: invalid use of member (did you forget the '&' ?)
If you have the time, take a look at this article. I wrote this article a while ago as a way to show how some std library features can be easily used for these types of exercises. http://cplusplus.com/forum/articles/10879/