Hi Guys,
Im trying to write a small function that when called will print out any records currently held in the struct.
If there are no records being held then a message will say no records.
If there are records then they will be displayed.
The code I have attempted runs but loops through all the code and displays the Max records all blank.........
I wondered if anyone could guide me a little.
Im using Borland 4.5 On WinXP
Regards as ever
C
Code:void display_all(void) { int key; int loop=0; while(loop < MAX) { if(my_database[loop].reg_no !="\0") { printf("\nReg ID : %s\n",my_database[loop].reg_no); printf("\nFirst Name : %s\n",my_database[loop].fname); printf("\nSurname : %s\n",my_database[loop].sname); printf("\nCredits : %d\n",my_database[loop].credit); printf("--------------------------------------------- "); printf("\n"); } loop++; } key=getchar(); }



LinkBack URL
About LinkBacks


