diff --git a/cv1/program.c b/cv1/program.c index 7268641..0eb7a8b 100755 --- a/cv1/program.c +++ b/cv1/program.c @@ -2,6 +2,7 @@ #include #include #include +#include struct item { char name[50]; @@ -85,6 +86,7 @@ int main(){ int input_search_size = strlen(input_search); int match_counter = 1; int new_start = 0; + char input_search_up = toupper(input_search[0]); //find match in menu for(int i = 0; i < meal_counter; i++){ new_start = 0; @@ -92,12 +94,12 @@ int main(){ //loop through each item name for(int j = 0; j < strlen(backup_menu[i].name); j++){ //if some word starts with first letter of input - if(backup_menu[i].name[j] == input_search[0]){ + if((backup_menu[i].name[j] == input_search[0]) || (backup_menu[i].name[j] == input_search_up)){ new_start = j; //loop through each letter in input_search for(int k = 0; k < input_search_size; k++){ - if(backup_menu[i].name[new_start] == input_search[k]){ + if(backup_menu[i].name[new_start] == input_search[k] || backup_menu[i].name[new_start] == input_search_up ){ match_counter++; }