Is there any difference on whether I initialize an integer variable like:
int i = 0;
int i;
Does the compiler or CLR treat this as the same thing? IIRC, I think they’re both treated as the same thing, but I can’t seem to find the article.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I looked at the IL (using ildasm) and its true that only the int set to 0 is really set to 0 in the constructor.
Generates: