c# - Why can I not set a Func to return a parameter type to an integer value? -


If the function returns the compensation, then I only return one type of return type to the last parameter function < .... in the parameter list ....

Q: Why can not I set the function to return type?

Or am I using the variable return result which is declared as above?

Neither do the work.

Code:

  int tempValueResult = Func & lt; int, int, int, int, int, int, int & gt; MyMeth6 = (a, b, c, y, e, returnResult) = & gt; {Console.WriteLine (a + b + c + y + e); Return (A); }; Console.WriteLine (returnResult);   

or -

  complete return result = 0; Function & lt; int, int, int, int, int, int, int & gt; MyMeth6 = (a, b, c, y, e, returnResult) = & gt; {Console.WriteLine (a + b + c + y + e); Return (A); };    

Why can not I set the function back to?

Because a function that returns a int is the function , not a int . The specific input given is the result is a int of that function.

In both instances, you have not given any value for input, so there is no one to get back the value is not until you provide inputs and evaluate the function You get a meaningful result.

Your second example works well, but you have to provide input and capture the output:

  returnResult = myMeth6 (1, 2, 3, 4, 5) );    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -