My code is the following
int tmpCnt;
if (name == "Dude")
tmpCnt++;
Why is there an error "Use of unassigned local variable tmpCnt"?
I know I didn't explicitly initialize it, but due to Default Value Table a value type is initialized with 0
anyway. The reference also reminds me:
Remember that using uninitialized variables in C# is not allowed.
But why do I have to do it explicitly if it's already done by default? Wouldn't it gain performance if I wouldn't have to do it?