I'm almost certain this has been asked before, but I can't find it being answered anywhere.
When can I omit curly braces in C? I've seen brace-less return
statements before, such as
if (condition)
return 5;
But this doesn't always seem to work for all statements, i.e. when declaring a method.
edit:
Are the rules for brace omission the same as in Java?
See Question&Answers more detail:os