20 lines
448 B
C
20 lines
448 B
C
int choices_selecter(char * Items,int items) {
|
|
int choice =0
|
|
do{
|
|
printf("Select An Option:");
|
|
int i;
|
|
for (i=0, i<items;i++){
|
|
print("%d. %s\n",i+1,Items[i]);
|
|
}
|
|
printf("%d. Exit\n",i+1);
|
|
printf(">");
|
|
if(choice < 1 || choice > items+1){
|
|
printf("Invalid choice...press any key to retry....\n");
|
|
fflush(stdin);
|
|
getchar();
|
|
}
|
|
}while(choice < 1 || choice > items+1);
|
|
return choice;
|
|
|
|
}
|