1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

User Defined Variables in console calculator

Discussion in 'C++' started by Untamed1337, Aug 28, 2010.

  1. Untamed1337

    Untamed1337 New Member

    Aug 28, 2010
    Likes Received:
    Trophy Points:
    Hello all, I am running into a problem that not even google can apparently help me figure out.

    I have a console calculator using MuParserX [a math parser]. It has a lot of functionality with my combined features and the normal features of the parser.
    But, I want to do something special I have rarely seen in console calculators. I want users to be able to type
    x = 10
    And have it define a variable x as 10, which can then be later used in the console calculator equations.

    Now, how would I do this? I am okay with having a predefined amount of variables, ex. a, b, c, d... but I am not sure how to let the users define them. I can have them input x = 10, and grab the x... but if I grab the x, it wouldn't be directly setting the variable in my application... so I am really not sure where to go from here.

    I don't want to use text files or anything, so the variables would just be set temporarily, until the application is closed.

    Any help is appreciated, thanks!

Share This Page