Code syntax to reset variables to zero?
Trying to solve a bug in a plugin someone else made and wonder, does this one line of code set g_votes[0], g_votes[1] and g_votes[2] to zero?
g_votes[0] = g_votes[1] = g_votes[2] = 0; Or do you have to do it like: g_votes[0] = 0; g_votes[1] = 0; g_votes[2] = 0; |
Re: Code syntax to reset variables to zero?
They both do the same operation.
|
Re: Code syntax to reset variables to zero?
Yes, the first statement works. What it does is this:
PHP Code:
|
Re: Code syntax to reset variables to zero?
Quote:
PHP Code:
PHP Code:
|
Re: Code syntax to reset variables to zero?
I was actually referring to the result, not the actual operation.
I guess I should start choosing my words carefully. :bacon: |
| All times are GMT -4. The time now is 17:40. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.