I am trying to create program that asks a students information. However when I run the program the first questions is skipped? How do I fix that?
1 2 3 4 5 6 7 8 9 10 11 12 13 14
for(int x=0; x<i; x++)
cout<<"What is the students name? "<<endl;
cout<<"What Class is this? "<<endl;
cout<<"How old is the student? "<<endl;
cout<<"What grade is the student in? "<<endl;
cout<<"What was the student's grade for the class? "<<endl;
since you have not posted the code where I put this loop, I think there are two different types of problems:
First of all, you should use the type 'string' and type 'array' for use getline and assuming you still able to use the type 'array', should be of type 'char'.
In fact, if you only change the array type from int to char at least in the first two questions, you no longer have the problem of the jump of the first questions.