I am having trouble reading a last name , first name from a text file into a string array. When I compile the code, it is skipping the comma and saving each line as two separate names. How can I get it to include the comma in the name?
In line 30, you are putting the next word from the file input stream in your array. This word ends at the first white space (directly after the comma). I think you get the full names in your array if you try to read the file line by line using getline.
Also, since you are using "using namespace std;" you should reconsider the name of your counter variable, because now it can/will be confused with std::count (http://www.cplusplus.com/reference/algorithm/count).