By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,173 Members | 1,686 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,173 IT Pros & Developers. It's quick & easy.

cin two relational Operators

P: 1
I want to cin two characters for any of the six relational operators.
'>=' no problem or '!=' no problem.
The problem is for reading single character '<' and '>'.
My code wants to read two characters but what works for a second character
for a single character relational operator.
The blank character ' ' is not accepted.
Maybe I should define '<' as '<,' or '<.' to get a simulated second character
for cin to accept?
Oct 3 '07 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 5K+
P: 8,950
maybe rather than specifically reading 2 characters you should read a string and then parse it to see what you have uncluding raising a error in with the user if they have supplied invalid data.
Oct 3 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.