I am doing an C++ assignment on customizable scientific calculator. I wish to ask how to write a program that can automatically identify the variables when i load a formula?

for example, when i input a formula: x + y
the program will display: x?
y?

Recommended Answers

All 2 Replies

Look through the input string a character at a time. For anything that's a letter, display the letter and ask the user to enter a value.

Use XML and create a mark up of your own mathematical variety. XMLLite is pretty easy to use and you could write the input from the GUI to a mem block in an IStream.... this will greatly improve the ease of development of actual computations of formulas! IMHO..

commented: You've got to be kidding! -2
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.