Define parameters instead of variables.
f(x){int y=x+1;...}
f(x,y){y=x+1;...}
You don't need to actually pass the second parameter.
Also, you can use operator precedence to save parenthesis.
For example, (x+y)*2
can become x+y<<1
.
Define parameters instead of variables.
f(x){int y=x+1;...}
f(x,y){y=x+1;...}
You don't need to actually pass the second parameter.
Also, you can use operator precedence to save parenthesis.
For example, (x+y)*2
can become x+y<<1
.