Im new to C++ and having a bit of a problem,
I have a program, written in Visual C++, designed to take in data and then let a user search through it but while it lets the user search it never comes back with my error message if the search isnt successful
when executed, if an invalid search is entered it just skips past the error message and straight into the next function but valid searches are fine, any suggestions as to why would be really appreciated
I have a program, written in Visual C++, designed to take in data and then let a user search through it but while it lets the user search it never comes back with my error message if the search isnt successful
Code:
{ char search_town[16]; int result = 0; int sub = 0; bool custfound = false; gotoxy (22,13); Input (search_town,15); do { result = (_strnicmp(search_town,record[sub].town,strlen(search_town))); if (result == 0) { DisplayCustomer(record[sub]); custfound = true; } sub ++; } while (sub < count); if (custfound = false) { Error("*No record matching that search found*"); PressKey(); SearchDetails(record, count); } }
Comment