Heh, you hit a C pet peave of mine. This:
if( objPtr != NULL && objPtr->foo ){ ... }
doesn't actually call any methods. You need objPtr->foo() for that. And the ANSI C committee should have made the "&" for getting a pointer to a method mandatory instead of optional and discouraged, as needing to do that is relatively rare, rarer than the mistake of not realizing that C requires the parens unlike several other quite similar languages. Further, this particular mistake usually results in compiler output that is quite difficult to diagnose, IME.
- tye
In reply to Re^3: AND OR (C meth)
by tye
in thread AND OR
by hasimir44
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |