My code is the following
int tmpCnt; if (name == \"Dude\") tmpCnt++;
Why is there an error Use of unassigned local variabl
Use of unassigned local variabl
local variables don't have a default value.
They have to be definitely assigned before you use them. It reduces the chance of using a variable you think you've given a sensible value to, when actually it's got some default value.