Alex Rivera | Logout

Does C# support if codeblocks without braces?

Asked 2010-12-03T13:15:55.933
28

How would C# compile this?

if (info == 8)
    info = 4;
otherStuff();

Would it include subsequent lines in the codeblock?

if (info == 8)
{
    info = 4;
    otherStuff();
}

Or would it take only the next line?

if (info == 8)
{
    info = 4;
}
otherStuff();
Edit
Report

1 Answer

9
if (info == 8)
{
    info = 4;
}
otherStuff();
answered 2010-12-03T13:17:16.327

Your Answer