cout << ">Please enter a letter: \n>";
What i am trying to work out is how to restrict the user for only entering one letter - has to use a string due to being used in a function later which only takes a string .... i know i hate to say this on here but help ( have tried googling) :D
First thing you need to decide is what happens if 2 or more characters are entered? If this is not a concern, just use cin.get() . Keep in mind all the extra characters will be waiting for the next input. That can mess the user input up royally.
If it is a concern and you only want the first character, read the entire line into a temporary string and move the character into the input string.
Third option is jonsca's suggestion.
Thank you all for your reply's
@jonsca - Unfortunately i did not write the function and cannot change it
@L7Sqr - I cannot use String.
@waltp - jonsca method works as i can just return false if more than one input is entered.
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...
Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...