EOSERV Forum > Programming > Confused about operators
Topic is locked.
Page: << 1 >>
Confused about operators
Author Message
Post #141011 Confused about operators

I try to use operators like == or != in if() and codeblocks keeps giving me errors like "no match for operator!= in variable!="text"

Is there a different type of operator system for codeblocks o.o? or was this defined in the code itself.

And where could i find information on this :o? like a reference or something.

14 years, 8 weeks ago
Post #141058 Re: Confused about operators

those operators look valid, post one of your if statements.

14 years, 8 weeks ago
Post #141064 Re: Confused about operators

well pretty much any if() statement

example:

if(randomvar=="randomtext")

{

ect...

}


i think codeblocks does it a different way that might be why. I havent seen any if statement use it that way in the code but im not sure what to describe the way its being used as. o.o but then again im quite new to c++ and even newer to codeblocks :s

most of the if statements i see in eoserv code call upon other functions for return values.

14 years, 8 weeks ago
Post #141066 Re: Confused about operators

if you are comparing 2 variables that can't be compared you'll have problems.


ex:

if (this->character == "string of text")

{

//etc

}

will get you trouble

if (this->character->name == "string of text")

{



//etc

}

is fine because they are the same type.

---
Love you too.
14 years, 8 weeks ago
Post #141078 Re: Confused about operators

Ah, that might be it. I probably forgot to label it properly. o.o

I'll have to check it out when i get home later.

14 years, 8 weeks ago
Page: << 1 >>
Topic is locked.
EOSERV Forum > Programming > Confused about operators