int menu(void) {
int menuOptLen = 3;
int menuOpt[] = {1, 2, 3};
int k = -9999;
while(elemNotInList(k, menuOpt, menuOptLen)) {
system("clear");
printf("=> " ANSI_COLOR_YELLOW "MENU!" ANSI_RESET_ALL "\n");
printf("1.START\n");
printf("2.LEAVE\n");
printf("3.RESUME\n");;
printf("=> " ANSI_COLOR_YELLOW "\t\t\t Select an Option!" ANSI_RESET_ALL "\n");
k = (int)(getc(stdin) - '0');
}
return k;
}
can someone explain what is the function of k ? and exactly what is this row for? k = (int)(getc(stdin) - '0');