When I make a string to hold a set of characters in and prompt the user with an extraction operator, A.K.A. cin >> whatever the program freaks out when I enter some thing with spaces, or acts weird. How do I stop that?
Like on prompt, I check to be certain the program is stable under any possible user circumstances or choices so I know the program is stable and has good logic and control meaning a good interface.
A bad interface would be a program that fails to do some thing just because there's a space in it.
So how can I end the "space" problem when entering characters in a string?
But that will only help with the spaces, and I'll have to assure that a string compares to an exact comparison for it to result true.
That's still leaving it complicating on the par that a user can input any thing they wish(with as much or little space possible, ultimately making it a pain to be able to catch all possible entries with spaces or not)and that must be understood logically and handled by the program. I'm sorry if you don't get it.....
I tried. I know every thing can't be handled, too many choices, but I want my program to handle things that are input logically(know what to do if what you entered is incorrect, not upper/lower case or not a fitting answer)rather than to just quit and take the easy way.
Most people just prompt some thing, and if you enter some thing wrong they give the logic for it to just quit rather than to handle the wrong input and clarify it(correct it, let the user know it's wrong, etc).
Sorry if you don't understand....I tried. :(
Please don't tell me I'm dumb for wanting to make a program like this.
I want to be able to program the program to handle spaces and treat them as would with out them so if the user inputs some thing that may not be exactly fitting for one possibility then it will be able to catch a differently input string.
For example:
"What is your name?"
Jessica.
"Your name is Jessica."
------------------------------
"What is your name?"
jessica.
"Your name is jessica."(WRONG! A name must be capitalized. Error must be treated.)
------------------------------
"What is your name?"
JeSs i C a
"Your name is JeSs i C a."(Wrong again! It should be able to catch this error that spaces don't go between letters in your name.)
Do you get my point?
If left untreated, the program will either panic/freeze or lose focus if it isn't given the logic to work around such possible errors a user may input and treat them the right way.