Hi there, I am very new to C++ and I am encountering a problem in my work. I have a program that Adds, Removes, Sorts, Finds, and Displays character inputs, such as names. The program takes first and last names successfully. Where my issue comes in though is I am trying to add in the functionality of having it format the inputted names as per this example when displayed:
Ahh, oops, that was me toying around and I forgot to remove it, ill edit the post.
These are the two lines (17 and 18) I accidentally left in.
str.find(' ', 0)
I mostly understand what I have wrote so far, however, as part of my current assignment, I am having trouble understanding how to format the names, or where to even put the conversion in my program.
What I wrote is what I mean. You formated the code badly.
EDIT: As for your problem then you are entering a string of two words but in all other functions you are entering only one word and trying to compare it with a string of two words.
That is using getline you entered two words. But using operator >> you entered only one word. It is obvious that two words can not be equal to one word.