Home Segments Index Top Previous Next

419: Mainline

Just as you can retrieve member-variable values through dereferenced pointers, you also can execute functions. The following, for example, executes the volume function on the cylinder pointed to by *cptr:

(*cptr).volume ( ) 

Note that, again, you must enclose *cptr in parentheses to defeat C++ normal precedence assumptions.