dxt Posted October 10, 2010 Share Posted October 10, 2010 (edited) Q1: What, if any, value does an uninitialized array element get and is it guaranteed? Q2: How/can do you differentiate a value of zero (0) from the empty string ("") in a condition like (If $x = 0), for example? Edited October 10, 2010 by dxt Link to comment Share on other sites More sharing options...
nekkutta Posted October 10, 2010 Share Posted October 10, 2010 A1: the value is a 0 length string "" A2: you would want to do this: If $x = "0" [size="2"] "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian Kernighan[/size] Link to comment Share on other sites More sharing options...
dxt Posted October 10, 2010 Author Share Posted October 10, 2010 A1: the value is a 0 length string "" A2: you would want to do this: If $x = "0" Thank you very much! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now