Help Please: Detecting Operators in Input

This is a discussion on Help Please: Detecting Operators in Input within the C++ Programming forums, part of the General Programming Boards category; Hi, I plan to make a program that finds variable values in compound equations. I have all the knowledge I ...

  1. #1
    Registered User
    Join Date
    Apr 2007
    Location
    Illinois, USA
    Posts
    10

    Unhappy Help Please: Detecting Operators in Input

    Hi,

    I plan to make a program that finds variable values in compound equations. I have all the knowledge I need to do the equations myself but I do not know how to make my program recognize the entered equation as an equation. Furthermore, and most importantly, I need to know how to make the program enter each number as an individual number between operators. So this is what I need to do:

    x + 4 = 0, find 'x'.

    Except I don't want to do it, I want to enter it and have the computer do it.

    So if you can help anywhere from recognizing individual terms to recognizing and excecuting operators please respond.

    Thanks,
    Hatchet

  2. #2
    Registered User Noir's Avatar
    Join Date
    Mar 2007
    Posts
    218
    That's hard. You'll be writing your own expression parser and evaluator, and it's not an afternoon project unless you keep it really simple. I'd say look into recursive descent parsing, expression trees, and postfix conversion and evaluation with stacks to get the skinny on how it works.

  3. #3
    Registered User
    Join Date
    Apr 2007
    Location
    Illinois, USA
    Posts
    10
    Thanks, Noir. I will research those things and try it out.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. input redirection
    By sashaKap in forum C Programming
    Replies: 6
    Last Post: 06-25-2009, 02:59 AM
  2. Checking array for string
    By Ayreon in forum C Programming
    Replies: 87
    Last Post: 03-09-2009, 04:25 PM
  3. I would love some input on my BST tree.
    By StevenGarcia in forum C++ Programming
    Replies: 4
    Last Post: 01-15-2007, 01:22 AM
  4. About aes
    By gumit in forum C Programming
    Replies: 13
    Last Post: 10-24-2006, 04:42 PM
  5. Structure and Linked List User Input Question
    By kevndale79 in forum C Programming
    Replies: 16
    Last Post: 10-05-2006, 12:09 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21