Avoid catastrophic function-argument type declarations
If you're declaring a function where all five arguments are int
s, then life is good. you can simply write
f(a,b,c,d,e){
But suppose d
needs to be a char
, or even an int*
. Then you're screwed! If one parameter is preceded by a type, all of them must be:
f(int a,int b,int c,int*d,int e){
But wait! There is a way around this disastrous explosion of useless characters. It goes like this:
f(a,b,c,d,e) int *d; {
This even saves on a standard main
declaration if you need to use the command-line arguments:
main(c,v)char**v;{
is two bytes shorter than
main(int c,char**v){
I was surprised to discover this, as I have not so far encountered it on PPCG.