Skip to main content
1 of 2
orp
  • 261
  • 2
  • 5

Maybe somewhat obvious but...

Make use of operator return values

Keep in mind that the assignment operator returns a value!

For example, if you want to add y to x and then check if x is greater than something, you can do

if((x+=y)>25)

instead of

x+=y
if(x>25)

Or maybe you want to find the length of a string after trimming it:

strlen(s=trim(s))

Rather than

s=trim(s)
strlen(s)
orp
  • 261
  • 2
  • 5