0

Need help fixing my code for a menu asapp

#include <stdio.h> #include <stdlib.h> #include <conio.h> #include <string.h> int q1[5]; int q2[5]; int q3[5]; int counter; int counter2; int pfchk[5]; float ave; float avearr[5]; char n[5][31]; void Table() { int count; printf("\nName\t\tQuiz 1\tQuiz 2\tQuiz 3\tAverage\tRemarks"); do{ printf("\n%d.)%s",count,n[count]); printf("\t%d",q1[count]); printf("\t%d",q2[count]); printf("\t%d",q3[count]); printf("\t%6.2f",avearr[count]); if (pfchk[count] == 1){ printf("\tPassed"); } else { printf("\tFailed"); } count++; }while (count != counter); } void delete(){ int L; Table(); printf("\n\nInput the number which you would like to delete: "); scanf("%d",&L); if (L>0){ } else{ strcpy(n[L],"[Deleted]"); q1[L] = 0; q2[L] = 0; q3[L] = 0; avearr[L] = 0; pfchk[L], "[Failed]"; } } void Inputs() { printf("\nInput name: "); scanf(" %[^\n]%*c",&n[counter]); printf("Input quiz1: ");

18th Mar 2021, 12:53 AM
Joshua
3 Antworten
+ 1
*delete is a keyword and cannot be used. Thanks Flash I just assumed that since I've have problems before with trying to use that as a variable. Looked it up and you're totally right. your Inputs() function is missing a closing bracket. there is also no main() function
18th Mar 2021, 1:15 AM
Slick
Slick - avatar
+ 1
delete is a C++ keyword, which has no meaning in C.
18th Mar 2021, 1:55 AM
Flash
0
Thank you it works now but there seems to be something wrong with the display option when i run ut
18th Mar 2021, 3:40 AM
Joshua