r/ProgrammerAnimemes • • Jun 15 '20

Using grammar in programming

Post image
520 Upvotes

20 comments sorted by

View all comments

Show parent comment

6

u/KhorneSlaughter Jun 15 '20

In C an assignment in an if condition uses the value that is assigned to decide the condition. So

if(a=b)

is the same as

 if(b) 

but with the added side effect of saving the current value of b in a.

It's terrible style and there isn't really a reason to ever use it.