equal bool help

Hello together,

i use this

 
  if(equal(nochmal, "Ja"))


but how can i use this so it is NOT EQUAl nochmal "ja" ?

Thanks in advance
if(!equal(nochmal, "Ja"))
if equal() is a user-defined function,
if(!equal(nochmal, "Ja")) { }
is what you're looking for.

! is the negation operator used to change true to false and false to true.
http://www.cplusplus.com/doc/tutorial/operators/

If that's not a user-defined function, then that's wrong use of std::equal
http://www.cplusplus.com/reference/algorithm/equal/
There aren't any overloads that take 2 arguments. So it wouldn't have compiled.

As a general,
You should use strcmp to compare to cstrings
http://www.cplusplus.com/reference/cstring/strcmp/

To check whether two strings are equal:
if(strcmp(nochmal, "Ja") == 0) { }
And for when you want to check whether they're not equal:
if(strcmp(nochmal, "Ja") != 0) { }

Is there a better standard function to compare two cstrings? me donnos
Topic archived. No new replies allowed.