"Mario Contreras" <ma***@txpos.com> wrote in message
news:2I********************@twister.austin.rr.com. ..
I need to ask the user to enter input like
true && false || ( true && true)
and display the output either true or false..,
any ideas???
can I use cin to put values in variables or cin.getline..
That's not really the biggest problem you will have. Its more or less
irrelevent.
Any help will be appreciated...
You need to write a parser. How to do this is far too complicated to explain
in a newsgroup posting. Suggest you buy a book which explains parsing
techniques. For instance 'The C++ Programming Language' by Stroustrup has an
arithmentic expression parser as an example. You want a boolean expression
parser (or truth table as you put it) but the principles are the same, you
should be able to adapt the code.
john