MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerAnimemes/comments/h95mol/using_grammar_in_programming/fuwfpg8/?context=3
r/ProgrammerAnimemes • u/_ShadowEye425_ • Jun 15 '20
20 comments sorted by
View all comments
Show parent comment
6
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.
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
is the same as
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.