-9

I want to create a smart calculator....other than user defined routines to solve maths equations ...like

private int  add(int num1,int num2)
{
   return x+y;
}

//in this case the user should enter two numbers and press the add key(if using GUI)

but i want to tell my calculator how to handle the calculation at run-time. rather than having a fixed number of routines ,, i would like to add user defined functions...or routines at runtime any help would be appreciated ...

leppie
  • 109,129
  • 16
  • 185
  • 292
HackerMan
  • 798
  • 6
  • 11
  • 1
    Take a look [here](http://stackoverflow.com/questions/1024070/c-sharp-eval-support) and see if that is helpful. – John Wu Apr 05 '14 at 20:10

1 Answers1

3

CSharpCodeProvider and ILGenerator will both let you generate code at runtime... that said creating code at runtime doesn't seem to make much sense to me for your use case.

Yaur
  • 7,016
  • 1
  • 22
  • 35