say i have the following:
string myArray[] = { "adam", "aaron", "brad", "brandon" };
cout << "Please type a name: ";
i want it so when a user types "bra" and hits enter, the program returns
brad
brandon
if the user types "a", the program returns
adam
aaron
if the user types "adam", the program returns
adam
I have tried strstr, mystring.compare(str), mystring.compare(x, n, str) - i can't find anything that is working.
what function would be the best way of handling this operation?