Unassigned value error asp.net C#

Posted by slash shogdhe on Stack Overflow See other posts from Stack Overflow or by slash shogdhe
Published on 2010-12-23T11:49:02Z Indexed on 2010/12/23 11:54 UTC
Read the original article Hit count: 160

Filed under:

if variable is not assigned,then it takes the default value at run time. for example

int A1;

if i will check the value of A1 at runtime it will be 0; then why at compile time it throws a error of unassigned value; why clr dont use to alot the default value at runtime;

int A1; int B1 = A1+10;

it shud be 11 as the default value of A1 is 0;

there project property where i can check for "assignn defalut values for unassigned variable"; can any one tell me where i can find it;

© Stack Overflow or respective owner

Related posts about c#