I'm very new to C++ and for my assignment they want me to create a function that gets the users input which I've done here: (classList is an array)
public:
void userInput() {
string enterAgain;
do {
cout << "Enter the students name: " << name;
cin >> name;
cout << "Enter the number of classes the student is enrolled in: " << numClasses;
cin >> numClasses;
for (int i = 0; i < numClasses; i++) {
cout << "Enter the class list: " << (i+1) << classList;
cin >> classList;
i++;
}
cout << "Would you like to enter again (y for yes): " << enterAgain;
cin >> enterAgain;
} while (enterAgain == "Y" || enterAgain == "y");
}
When I run the program it will ask the user for the students name followed by the number of classes they're taking, but when it ask the user to input the class list it displays something like this:
Enter the class list: 0x7fff536d1b78
But in addition to this it won't let me input anything. I searched for hours trying to correct this problem and I was hoping someone could point me in the right direction in correcting this problem. Thanks!