Ok I tend to write walls of text to make sure all info is provided, I will try my best to keep this short. I am very confused on the proper usage of input. I've been doing this for about a week and have used cin >> simply because I can't seem to get strings to work, or getline() anyways. Ok so what im doing is getting input from user then using if statements to check if y or n was pressed and to return error if neither was pressed. I have things working fine but as we all know in console if I enter nn it will answer n to the next question as wellI've read about arrays and C style strings but guess Im missing the implementation of it. How can I get ONE char from the user and if say nn is pushed it only takes the first n. This has been my problem for three days and finally had to ask someone for help. So if you could give me some pointers It would be greatly appreciated
Also im happy to post my code if need be just didnt want to post it wrong considdering i dont know the BB code or whatever used to segregate my code from rest of post.... TY for listening and wait patiently for help![]()




I've read about arrays and C style strings but guess Im missing the implementation of it. How can I get ONE char from the user and if say nn is pushed it only takes the first n. This has been my problem for three days and finally had to ask someone for help. So if you could give me some pointers It would be greatly appreciated 
Reply With Quote