[SOLVED] Check a variable
Hello
I want to verify if a variable is empty or not I try this but it doesn't work : Code:
new reason[32] |
if(!reason[0])
doing it your way it will see if the last character is 0 which will always be true. |
Huuummm
Ok thanks (+karma) |
In fact, doing it his way won't do that either because the last valid index in a 32-elements array is 31; so reason[32] will be either caught by the compiler (it should), or it will cause an out-of-bounds runtime error.
Suicid3 is right, if the first character (index 0) is zero, the string is empty. |
Hello PM[/code]
Code:
AM |
| All times are GMT -4. The time now is 05:05. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.