View Single Post
  #1   Spotlight this post!  
Unread 26-01-2005, 17:13
psquared psquared is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Chantilly
Posts: 34
psquared is an unknown quantity at this point
Weird problem with if statements

When we were doing some programming today, i wrote a good length section of code, with a few if statements thrown in there, in some of the if statements i had if(blah = blah), well i spent a good period of time trying to figure out why the code wasn't working right, and it turns out it should have been if(blah == blah), im used to java and doing it that way, but when i compiled the first time in c with if(blah = blah) it worked fine, so i thought it was fine. there is no real problem here, i just thought to let some other people know who might be running into problems and don't know why, to check that they have ==, not =, also what does = mean in an if statement?

Hope this helps anyone that needed it, and thanks for answering what does = mean if it isn't the same as ==?