Hacker News new | past | comments | ask | show | jobs | submit login

As long as you're not using prehistoric versions if C, you don't have to define all variables up front, so there is much less justifiable reasons for that kind of multiple declaration.



Except nothing will save you from the "one true way to write C" when you try to write a declaration of a pointer to a function, for example.


You can adjust your function pointer typedefs if you like. e.g. signal(2) http://man7.org/linux/man-pages/man2/signal.2.html

  typedef void (*sighandler_t)(int);
  sighandler_t signal(int signum, sighandler_t handler);
can be rewritten as

  typedef void sighandler_t(int);
  sighandler_t *signal(int signum, sighandler_t *handler);


yep, I prefer the c++ way by far : using foo = void(int, float);




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: