Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In the C grammar, braces denote compound statements. Control flow statements can take any type of statement as their body rather than just the compound variety.


It confuses me that it doesn't work for functions. like

    int main() return 0;


In K&R C, the function braces serve to separate parameter declarations and local variables:

    int main(argc, argv)
      int argc;
      char **argv;
    {
      int local;
    }


Thanks, I haven't seen that syntax before.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: