I need to be able to take a input file like
4
Brianna
Paul
Lindsey
Lisa
and search Li and find Lindsey and Lisa
Right now I can only find the element if the full string is entered. How can I search the array with only a piece of the array entered?
Also I have to use arrays I can not use vectors.
You can look for prefixes by, instead of using ==, use the find() method of the std::string class to find substrings and check to make sure it appears at the beginning of the string.
This is invalid C++. VLA arrays are not allowed by C++ Standard. Some compiles might allow them, but it highly unportable and there is great possibility that it will not compile on other machines.
How can I search the array with only a piece of the array entered?
DO you need only matches from the beginning of string, e.g. in array {Lisa, Colibri} search by "Li" will find only "Lisa"? Should it be case sensitive?