Skip to content

Commit

Permalink
Better closing of Program with prompt and formatted view and iview 😄
Browse files Browse the repository at this point in the history
  • Loading branch information
adiultra committed May 25, 2016
1 parent 7b25676 commit 7a4d1a0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Binary file modified data.tdx
Binary file not shown.
4 changes: 2 additions & 2 deletions fabric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void List::view() {
cout << tags[i] << " ";
}

cout << endl;
cout << endl << endl;

for (int i = 0; i < _listIndex; i++) {
cout << " [" << list[i].status << "] ";
Expand All @@ -116,7 +116,7 @@ void List::indexView() {
cout << tags[i] << " ";
}

cout << endl;
cout << endl << endl;

for (int i = 0; i < _listIndex; i++) {
cout << i << ". [" << list[i].status << "] ";
Expand Down
12 changes: 10 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,15 @@ int parse(char command[80]){

else if (!(strcmp(command, "quit")*strcmp(command, "q"))) {
// exit the program after saving it to the file
arrayL[_currentLindex] = currentL;
finish();
char confirm[10];
cout << "Enter \'yes\' to continue" << endl << " ?> ";
cin.getline(confirm, 10);

if (!strcmp(confirm, "yes")) {
arrayL[_currentLindex] = currentL;
finish();
}

success = -1;
}

Expand Down Expand Up @@ -222,6 +229,7 @@ int main() {
cout << "Internal Error" << endl;
}
else if (result == -1) {
cout << "Closing the Program, Have a Great Day :)" << endl;
break;
}
}
Expand Down

0 comments on commit 7a4d1a0

Please sign in to comment.