That's the oldest gotcha in the C book. Welcome to the club
The problem is that "if (a=b)" is a perfectly legal statement. It just that it doesn't do what the programmer expected.
but presumably the same run time code
therefore I think it's fair to say that it's not good coding practice
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16