I'm not quite sure if this should be in the asp.net, or possibly the c# forums...
I'm writing an asp.net calculator application in C#, and at this point it would be very useful if I could somehow save an operator in a variable, and then be able to use it later on, like this:
Let's say I have the integer session variables a=2 and b=4
[CODE=C#]
protected void button_add(obje ct sender, EventArgs e)
{
operatorvar opx=+;}
protected void button_equals(o bject sender, EventArgs e)
{
int answer=a opx b;}
[/CODE]
I also want the operator to be in a session variable.
Is this at all possible? I did some googling, but ended up coming back here.
I'm writing an asp.net calculator application in C#, and at this point it would be very useful if I could somehow save an operator in a variable, and then be able to use it later on, like this:
Let's say I have the integer session variables a=2 and b=4
[CODE=C#]
protected void button_add(obje ct sender, EventArgs e)
{
operatorvar opx=+;
protected void button_equals(o bject sender, EventArgs e)
{
int answer=a opx b;
[/CODE]
I also want the operator to be in a session variable.
Is this at all possible? I did some googling, but ended up coming back here.
Comment