I need help doing a menu driven database program. I need a Main Menu, with a few options. One of the options is to create a new record in a table. Can anyone help me go from a main menu screen to the actual database to create a new entry?
Thanx!
I need help doing a menu driven database program. I need a Main Menu, with a few options. One of the options is to create a new record in a table. Can anyone help me go from a main menu screen to the actual database to create a new entry?
Thanx!
Code:do{ printf("1. Make a new database\n"); printf("2. Add a person\n"); printf("3. Remove a person\n"); /*blah blah blah*/ fgets(buffer,sizeof buffer,stdin); while(buffer[0]!=1|| buffer[0]!=2|| buffer[0]!=3); if(buffer[0]==1) add_database(); /*blah blah rest of code*/
> buffer[0]!=1
Should be
buffer[0]!='1'
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Thanx