If the user presses enter without entering any changes (i.e. want the current information in the database to stay the same) I need it to keep the existing entry and for the program to continue to the next field change. Obviously, when the user wishes for the entry to be changed and enters the new information and it replaces the current entry in the database.
But the problem is, I cannot have an empty string. When I press enter it waits for me to input a character/s. I need the program to continue on when I press enter.
void edit(int entryNumber, int numberOfEntries)
{
char in[20];
//Clear cin from previous selection in order for the below to work.
cin.ignore();
cout << "Enter new status (existing: " << database[entryNumber].status << "): ";
cin.getline(in, 20);
if (in[0] != '\0')
strcpy(database[entryNumber].status,in);
...