469,909 Members | 1,617 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,909 developers. It's quick & easy.

cin two relational Operators

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
1 1137
Banfa
9,065 Expert Mod 8TB
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.

Similar topics

27 posts views Thread by glen herrmannsfeldt | last post: by
8 posts views Thread by Greenhorn | last post: by
3 posts views Thread by Robert Abi Saab | last post: by
14 posts views Thread by AliceB.Toklas | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.