Can You Go Without Brackets?

Question, is:

 
  while(true)if(2==2)cout<<42;


The exact same thing as:

1
2
3
4
5
6
7
  while (true)
  {
    if (2 == 2)
    {
      cout<<42;
    }
  }
Yes. But keep in mind if there are not braces it will only include the next line statement.

Last edited on
OK, Thanks, I guess that's the part that confused me!
Topic archived. No new replies allowed.