I am trying to write a student database. I've done most of it, however to improve im trying to write something that will display the infomation entered and then ask if this is correct, if it is then continue if not then start back at the entering data part.

here is an example of what ive got, its a long bit of code so i havnt included all of it, so it wont compile. Thanks.

cout<<"Enter name of student..."<<endl<<endl;
			getline (cin,pname,'.');
			cout<<"Enter student id number..."<<endl<<endl;
			char choicecourse;

			student **store = new student*[nocourses];// I have a class called student made above

				for(int j=0;j<nocourses;j++)
				string pcourse;
				string pgrade;
				int ppercentage;

				cout<<"Course "<<j+1<<", Is the student taking EM, Particle or C++ [E,P,C]?"<<endl;
					case 'E':
					case 'e':
					cout<<"Enter the grade for the student taking EM..."<<endl;
					cout<<"enter the percentage for the student taking EM..."<<endl;
					store[j] = new physstd(pname,pID,pcourse,pgrade,ppercentage);
					physstd a(pname,pID,pcourse,pgrade,ppercentage);
					cout<<"Incorrect course"<<endl;
			for(int j=0;j<nocourses;j++)
				delete store[j];
				}  // Here i display the infomation the user has entered.  I would like then to ask if this is correct. if it is then break if not then go back to the beginning of the for loop 
			delete[] store;

obviously the remainder of the switch is below. Any help on this would be much appreciated. Thanks

Solved. A do{}while loop works.

Hey I have tried the same before seeing this. But its showing me error in the program. After trying much I got the output for it. But it was giving me wring out put. When I enter correct value or incorrect value it always accept that value. But after watching your code I got the right output.