View Single Post
  #2   Spotlight this post!  
Unread 26-01-2005, 17:26
Don Reid Don Reid is offline
Registered User
#0997
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Corvallis, Oregon
Posts: 45
Don Reid will become famous soon enough
Re: Weird problem with if statements

Quote:
also what does = mean in an if statement?
"=" is an assignment. It also has a value, the value assigned.

So "if (a = b)..." means, Assign the value of b to a, then if that value is true (non zero) do something.

Don't feel bad. This is a common error even for experienced programers. The compilers don't complain because it is legal and sometimes done on purpose.
__________________
Don Reid