From ed1ce4142c45e090a2237bcbce107e0650cfefcc Mon Sep 17 00:00:00 2001 From: po79yr3at Date: Sun, 12 Nov 2023 23:13:18 +0800 Subject: [PATCH] Update main.c --- main.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/main.c b/main.c index c8f681d..1bb2206 100644 --- a/main.c +++ b/main.c @@ -69,18 +69,18 @@ void Info_Remove() } if(tp){ printf("Found:%d\n", tp); - Range(info){ - ord++; + Range(info) if(psf->id == num) info_format_print(p); - } - if(tp != 1) + + if(tp != 1){ + printf("Please type in the number of data that you want to remove\n"); scanf("%d", &num); - else num = 1; - if(num > 0 && num < tp){ + }else num = 1; + if(num > 0 && num <= tp){ printf("Make Sure To Remove?[yes/no]"); if(make_sure()){ - Array_deletepos(&info, stk[num-1]); + Array_deletepos(&info, stk[num-1]-1); printf("Remove Done\n"); }else printf("Canceling the option\n"); }else printf("illegal input of the Index\n"); @@ -105,11 +105,9 @@ void Info_Quiry() } if(tp){ printf("Found:%d\n", tp); - Range(info){ - ord++; + Range(info) if(psf->id == num) info_format_print(p); - } }else printf("Student [id:%d] Not Found\n", num); } int Info_sortById_a(void *a, void *b){