I am passing the parameter to the function as a var type. It is not accepting, how do I pass to the function?
Example
var Input = ................
listview1.itemsource = getinput(Input);
public List<answers>getinput(var inp)
{
................
..................
}
Here the function is not accepting the var. What can I do?
var can only be used when a local variable is declared and initialized in the same statement; the variable cannot be initialized to null, or to a method group or an anonymous function.
MSDN : Implicitly Typed Local Variables