C
C#8mo ago
w11

var keyword

does using the var keyboard as opposed to specifying the data type to declare variables affect the performance of the app ?
4 Replies
Jimmacle
Jimmacle8mo ago
no, there is no difference a variable declared with var still has a specific type, it's just a shortcut to not have to write it out
w11
w11OP8mo ago
alr thanks
jcotton42
jcotton428mo ago
specifically var is type inference, not dynamic typing or anything the following two lines are compiled to the same output
var i = 1;
int i = 1;
var i = 1;
int i = 1;
w11
w11OP8mo ago
thanks, that clears it up for me!
Want results from more Discord servers?
Add your server