0
how come i cant do var z, then do z = x+y
it just doesnt work
5 Respostas
+ 4
Did you initialize the other variables or made sure they are not local in unaccessible places?
+ 2
yes , you need to initialize the other variables first. after that the output of the variables can be taken in the var z. see below example:-
int x = 6;
int y = 4;
var z = x + y;
Console.WriteLine(z);
+ 2
oh, int z = x + y didnt work but var z = x + y does, thanks.
+ 1
i did that but it didnt work
+ 1
please share the little bit of the code...so we can check.