cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
operating symbols
operating symbols
Aug 6, 2013 at 3:15pm UTC
corbett
(18)
how to ask the user to input operating symbols like "+","-","*" and then use it to operate on the numbers. The user should be asked to input the symbols not like this
1.+
2.-
3.*
Aug 6, 2013 at 3:18pm UTC
closed account (
Dy7SLyTq
)
input into a char and run a switch on it. depending on the symbol perform the operation. ie:
[code]
case '+':
lvalue += rvalue;
break;
Aug 6, 2013 at 8:04pm UTC
Ahmad1797
(76)
there are plenty of ways
1) Use ASCII table and get values for algebraic symbols.
2) As DTSCode suggested you can use direct 'char' data type.
Topic archived. No new replies allowed.