i have to do this program that reads 15 employee records into a 20 element array, and that your able to search , add, remove, print , and exit . I have tired reading the tutorials and in my book but still very lost. This is a part of the program that has the switch statment. If anyone can help me out please.. it would be greatly appreciated
Code:int main() { student_record database[SIZE]; //database for student records char command; //holds the command to execute int count=0; //contains count of actual number of items in database initialize(database,count); printf("Enter a command: s=search, p=print, r=remove,i=insert, e=exit\n"); scanf(" %c", &command); { while (command!='e') switch (command) case 's' :search(student_record DB[], int count, char key[]) ; break; case 'p' : print_array(int x[ ], int count); break; case 'r': remove_record(student_record DB[], int * count, char key[]); break; case 'i': insert(student_record DB[], int * count); break; } printf("Enter acommand:s=search,p=print,r=remove,i=insert,e=exit\n"); scanf(" &c", &command); return 0; }



LinkBack URL
About LinkBacks


