October 3rd, 2012, 09:00 PM
New to C# A few Q's
Hi everyone. I'm new to C# (or any programming language for that matter) and am trying to figure something out. I'll give the following example.
For the above piece of code, why is it that the semicolon used to declare the variable, and for the MessageBox.Show statement, but not the if statement? What I'm getting at is, are there rules and what are they for when a semicolon is used and when is it not?
int SomeValue = 24;
if (SomeValue == 24)
MessageBox.Show("The Value is 24");
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.