
-----------------------------------
kk01
Sat May 19, 2012 9:59 pm

Questions, pls come in
-----------------------------------
I am using Dev-Cpp software. I have the following program. When I compile the program, the screen just pop-out and close instantaneously. I am confused and I think there must be an error in the do while loop since userInput was not set with a value. But, it still doesn't work. At least, at this point, I expect the welcome screen (Welcome to Database!) will show up. It doesn't work at all Can anyone help me with this? Thanks a lot :)) 


int main ()
{
	int number; // create a variable to store user designated #
	string userInput; // create a variable to store user instruction
	cout  number; // get newNum
			newRecord(number); // call newRecord function
		}
		else if (userInput=="help") // if userInput is help
		{
			helpMe(); // call helpMe function
		}
		else if (userInput=="edit")// if userInput is edit
		{
			editRecord(); // call editRecord function
		}
		else if (userInput=="delete") // if userInput is delete
		{
			deleteRecord(); // call deleteRecord function
		}
		else if (userInput=="save") // if userINput is save
		{
			saveRecord(); // call saveRecord function
		}
		else if (userInput=="load") // if userInput is load
		{
			loadRecord(); // call loadRecord function
		}
		else if (userInput=="sort") // if userInput is sort
		{
			sortRecord(); // call sortRecord function
		}
		else if (userInput=="search") // if userInput is search
		{
			searchRecord(); // call searhRecord
		}
	}
 	while(userInput!="stop"); // exit the loop when userInput is stop, otherwise, continue
	cout 