The problem is being caused because the extraction operator>> leaves the end of line character in the input buffer and when getline() encounters this character stops processing. So to fix the problem you need to remove this character. something like: getline(cin >> ws, record[0].name);.
By the way why are you creating an array of your structure, as a global variable no less, but only trying to retrieve the name of the first record. Perhaps you should have a normal single instance of your structure that has an array of quizzes instead.
I couldn't figure out what the problem was so I was placing the structure in and out the main function and a lot of other stuffs trying to figure out where the hell did I go wrong LOL.
Can I ask what the ws is for? And correct me if im wrong, is the end of line character this one? '\0'
EDIT:
A follow up question, if my code is something like
cout
for loop (3x)
{cin}
how do i make it so that my cin goes on the same line as my cout ?
When used with an input stream it tells the input stream to consume and discard all leading whitespace.
And correct me if im wrong, is the end of line character this one? '\0'
No that is more commonly referred to as the end of string character. The end of line character is '\n'.
how do i make it so that my cin goes on the same line as my cout ?
If you don't issue the end of line character or use endl the next operation will happen on the existing line. In your loop if you press the enter key the cursor will go to the next line. If you're using the extraction operator you can enter multiple items on the same line without using the enter key by just pressing the space key until the last entry.