Author |
Message |
Anborn Newbie
Joined: Dec 02 2002 Posts: 13 Offline
|
|
Back to top |
|
|
SOS Server Help Squatter
Joined: Dec 02 2002 Posts: 329 Offline
|
Posted: Sun Jan 12, 2003 1:51 pm Post subject: |
|
|
|
|
Hmm... I would say
if (r->name == s) {
should be
if (s == r->name) { _________________ 3y3 4m l33t h4x0r
j0! 3y3 4m t4lking to j00!
fux0red 5cr1pt k1dd13.
-"l33t h41ku" |
|
Back to top |
|
|
Anborn Newbie
Joined: Dec 02 2002 Posts: 13 Offline
|
Posted: Mon Jan 13, 2003 12:35 am Post subject: |
|
|
|
|
SOS - thanks... that did it... forgive me as my last programming class was 4 years ago... but why don't they do the same thing?! time to hit the net to figure out stuff I should have actually learned while I was in school hehe. |
|
Back to top |
|
|
SOS Server Help Squatter
Joined: Dec 02 2002 Posts: 329 Offline
|
Posted: Mon Jan 13, 2003 7:41 am Post subject: |
|
|
|
|
The == operator for the left operand is called. Just the way the language works.
In this case, the other way around would just compare the pointer to the char[] with the pointer to the String, which would always be false.
But since String has a == operator to check a char array, it works
BTW, if you're going for faster strings and more features, CString is a much better class to use than Catid's String.
It's in atlstr.h or afxstr.h(I think) if using MFC. |
|
Back to top |
|
|
Anborn Newbie
Joined: Dec 02 2002 Posts: 13 Offline
|
Posted: Mon Jan 13, 2003 9:21 am Post subject: |
|
|
|
|
cool thanks SOS... muchos gracias once again |
|
Back to top |
|
|
|