I’m trying to make a calculator-like program where one would enter a calculation in a textbox and it would convert that calculation to an int with the result, here’s what I have but it doesn’t work much
string calcStr = textBox1.Text;
int result = calcStr;
Any suggestions that aren’t too complicated?
Use NCalc for this kind of job… it is free, comes with source and does all the heavy lifting (parse the mathematical expression etc.) and gives you the result of the calculation.