trouble declaring an expression
I am using unity3d (engine for videogame design) which uses visual studio and C # language to program, I have included the maximasharp libraries and recognizes them without any problem, my problem is the following, the example given here, use the word " var" to define an algebraic expression, when I want to use that word, visual studio does not recognize me and tells me that I have errors in my code, the common thing I have to do in this engine, is to first declare the type of variable (like int, string, etc...) and then assign name and value, I have tried all possible types of variables that the VS handles, but I always have the error that says that the type of variable cannot be implicitly converted into an expression type.
How could you declare an expression?
In advance thank you very much for the help
The C# compiler treats expression trees in a special way. You can't use var to declare an expression tree because the C# compiler needs more information in order to create the expression tree. It must be declared explicitly like this:
Expression<Func<double, double>> f = x => 2 * x + 5;
Are you trying to create a math game? If you can provide an example of either the code you are having issues with or a mockup of what the game will be like and I might be able to help you out better.