im trying for hours to figure out what I'm doing wrong but can't seem to find a solution. I want to use getch() so I don't have to put enter to pass the input to a variable. Somehow i still have to press ENTER
Here the code:
#include "open_txt.h"
struct daten {
char *name[50][100];
char *adress[50][100];
char *birthday[50][100];
}data;
int main (){
printf("\n\n\tContacts\n\n");
printf("Main menu: \n\n");
printf("1. Add contact\n");
printf("2. Edit contact\n");
printf("3. Search contact\n");
/*char *filename;
filename = "Adressbuch.txt";
int c = fopen("Adressbuch.txt", "w");*/
int ui;
ui = getchar();
switch(ui){
case '1':
printf("\n\n\tADD CONTACT\n\n");
break;
case '2':
printf("\n\nEDIT CONTACT\n\n");
break;
case '3':
printf("\n\nSEARCH CONTACT\n\n");
break;
default:
printf("That's not an option!\n");
}
return 0;
}```