"<- Chameleon ->" <ch******@hotmail.NOSPAM.com> wrote in message news:<c1**********@nic.grnet.gr>...
is this line correct runtime?
------------------
if (a_class_pointer && a_class_pointer->a_member()) .....;
------------------
As others have stated, it's acceptable. You could rewrite this so.
if a_class_pointer
{
if a_class_pointer->a_member()
...
}
I prefer this. For example, when your "if" is not successful,
you don't know, without doing some dancing, whether it failed
due to the pointer being null or the memebr call returning false.
My way, you could put "else" cases in there.
Also, I'm usually not satisfied with a function that returns
true/false to indicate success/failure. If it's going to return
its status through its return value, I like an integer so I can
expand the possible results.
Socks