If I have a double variable that goes through a loop and gets numbers added to it, is it just as simple as saying variablename = 0 to reset it?
Jonesy
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, that will definitely reset the value. You need to think carefully about whether you actually want a double or an integer though – your title says one, and your text says another. In particular, you should almost never treat double values for equality, whereas with integers that’s fine. So you wouldn’t want
as your condition, but
would be fine.