Created
May 20, 2016 18:38
-
-
Save gregmankes/26fd02e2d17c7414d6a3708b2f5b5660 to your computer and use it in GitHub Desktop.
Main Function from todo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Main Function from todo | |
int main() | |
{ | |
// Implement | |
printf("\n\n** TO-DO LIST APPLICATION **\n\n"); | |
DynamicArray* list = dyNew(8); | |
char command = ' '; | |
do | |
{ | |
printf("Press:\n" | |
"'l' to load to-do list from a file\n" | |
"'s' to save to-do list to a file\n" | |
"'a' to add a new task\n" | |
"'g' to get the first task\n" | |
"'r' to remove the first task\n" | |
"'p' to print the list\n" | |
"'e' to exit the program\n" | |
); | |
command = getchar(); | |
// Eat newlines | |
while (command == '\n') | |
command = getchar(); // here is what is left out | |
handleCommand(list, command); | |
} | |
while (command != 'e'); | |
dyDelete(list); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment