|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#13
|
|||
|
|||
|
Re: Limit Swtich Help
Quote:
Code:
int x=0;
if(x=8)
{
}
Of course had I tried to code it, eclipse/netbeans/whatever would have let me know I was wrong long before I tried compile. Reminds me of the most 'duh' moment I ever had that IDE's don't tend to flag for us yet. I had coded something along the lines of int x=0; ... if(x==4 && something_else==2 && something_else==some_other_thing); { //some stuff to do } It took me the longest time to figure out why I kept entering the if clause even though I was nearly 100% certain that x was *not* 4 and thus the hypothesis should evaluate to false. Finally I put in a sanity check to print x and confirmed that I was right (x was not 4 and the full expression for the if evaluated to false). Only then was I able to see the error of my ways... sorry to send this slightly off topic.... I did appreciate the points made thoug. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|