473,672 Members | 2,511 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

cin two relational Operators

1 New Member
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 1303
Banfa
9,065 Recognized Expert Moderator Expert
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

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

Similar topics

1
1310
by: John Benson | last post by:
Hi, I've been looking at the "Oracle9 i Database New Features" guide, from which I quote: XML Generation In response to the challenge of generating XML in bulk from a database, XML generation capabilities have been moved into the database and application server kernels and made available as built-in SQL operators. The kernel proximity of these operators ensures massively sustainable throughputs, enough for the largest
9
1493
by: Balaji | last post by:
Dear Jeff, Thanks for your reply. I see that the PEP and the current docs specify that __ge__ and __le__ are their own reflection. Given that PEP 207 proposes rich comparison to handle cases (brought upon by NumPy) where the objects returned should not be assumed to be boolean, what is the argument for automatic reflection? Automatic reflection prevents the resulting objects from being
27
3119
by: glen herrmannsfeldt | last post by:
The subject recently came up in comp.compilers, though I believe that I asked here before. If you use relational operators, other than == and !=, on pointers to different objects, is there any requirement on the result? #include <stdio.h> int main() {
8
1563
by: Greenhorn | last post by:
Hi, Those relational operators have operands of all numerical type int,char,float etc. They also are working for character arrays. Whats the logic behind their working. Is the length of the array compared first and then each character compared with corresponding character. { const char msg = "msessage}", ch = "Za";
49
14880
by: raju | last post by:
hi can we compare two integers without using relational operators (== != < <= > >=) thanks rajesh s
3
6188
by: Robert Abi Saab | last post by:
Hi everyone. I just finished a course on PostgreSQL and I found out that PostgreSQL doesn't provide any object relational features (as claimed in the official documentation), except table inheritance and very limited user defined types (I defined a UDT with 2 attributes and couldn't use it in a table, and the trainer said it must contain 1 attribute at most so that it can be used (as a column) in tables) So my question is whether...
14
2555
by: AliceB.Toklas | last post by:
In my Absolute Beginner's Guide to C book by Greg Perry where it is instruction how relational operators work it gives the following example: int i = 5; so the following statement is true: int i == 1
0
8485
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8930
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8828
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8605
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8677
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7446
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4417
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2819
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2062
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.