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

Nice summary. However, the comment about first example is slightly inaccurate. Saying the `sayHello` function does not take arguments is wrong. It does, it just does not care about them. You could still call it with arguments like sayHello("world", 15) and there would be no compiler warning nor error.

If you want to declare a function with no arguments, just do it as `sayHello(void)`. Then, the previous example would result in compile-time error.



Updated with that info from the comments already




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

Search: