Hi, I got an issue dealing with cin.getline feature..
So, here is my code/function:
void studentRecord(char name[][300], int id[], int test1[], int test2[], char contact[][100], int size)
{
for(int i = 0; i < size; i++)
{
cout << "\nStudent No: " << (i) << endl;
cout << "\nEnter the student name: ";
cin.getline(name[i],300);
cout << "Enter the student ID: ";
cin >> id[i];
cout << "Enter the mark for Test 1: ";
cin >> test1[i];
cout << "Enter the mark for Test 2: ";
cin >> test2[i];
cout << "Enter the Contact No.: ";
cin.getline(contact[i],100);
}
}
so it was working well until the second loop begin. it skipped the enter name part. I really appreciate if you help with this problem. Anyway, you might be think that i should use struct instead of using this too many arrays!. Well, this is my assignment so i was told to use array so yeah....