diff options
| -rw-r--r-- | DynamicStudentList/DynamicStudentList.c (renamed from simple-C-programs/DynamicStudentList.c) | 8 | ||||
| -rw-r--r-- | README | 3 |
2 files changed, 9 insertions, 2 deletions
diff --git a/simple-C-programs/DynamicStudentList.c b/DynamicStudentList/DynamicStudentList.c index fcd7d25..ee1f44a 100644 --- a/simple-C-programs/DynamicStudentList.c +++ b/DynamicStudentList/DynamicStudentList.c @@ -311,6 +311,10 @@ int main() { free(name); break; case 4: + if (list->size(list) == 0) { + printf("No student available!, try a Entering some: "); + break; + } list = list->sort(list); if (list == NULL) { printf("No student available\n"); @@ -323,6 +327,7 @@ int main() { case 5: if (list->size(list) == 0) { printf("No student available!, try a Entering some: "); + break; } list->dump(list); break; @@ -330,10 +335,11 @@ int main() { case 6: if (list->size(list) == 0) { printf("No student available!, try a Entering some: "); + break; } tmp = list->highest(list); - printf("The best student is: %s, Age: %d, Mark, %d\n", tmp->name(tmp), + printf("The best student is: %s, Age: %d, Mark: %d\n", tmp->name(tmp), tmp->age(tmp), tmp->mark(tmp)); break; @@ -5,7 +5,7 @@ CONTENTS -------- * CHECK FILES IN THE TREE TAB - +* THIS README FILE WAS MEANT FOR CGIT ON MY OLD SERVER NOT GITHUB - The greatest common divisor exercise solution, in ROOT/GCD/GCD.c - Hexadecimal to integer converter solution, in ROOT/HTOI/HTOI.c @@ -18,3 +18,4 @@ CONTENTS - Made the hangman game(a word guesser basically) in C, <3, in ROOT/HangManGame/HMG.c - Added a simple snakes and ladders game as an exercise in C, in ROOT/snakesAndLadders/snakesANDladders.C - Added a folder containing simple-C-programs that i just wrote when i was absent and not coding for the past period. +- A dynamic student list with basic functions (trying to understand linked list and implementing one in a project), in ROOT/DynamicStudentList/DynamicStudentList.c
\ No newline at end of file |
