Hello everyone. I believe this is my first post here. This forum is incredibly helpful. Thank you to everyone who contributes!
I'm building a program that reads a list of names (first name and last name) stored in a file and assigns it to an array. I would then like to sort the array in alphabetical order (by first name). Lastly, I have to include a binary search so that the user can type in a name and the program will be able to tell if that name is in the array or not. However, I haven't even gotten to that part because I keep getting the following error message when I compile my code:
"error C2440: '=' : cannot convert from 'std::string' to 'int'"
with reference to this line "friendNames[smallestIndex] = temp;"
I'm a bit confused. Can anyone please point out what I'm doing wrong. Thank you!