1. C and C++ have a basic style that says variables are declared in the same format in which they're used. Other examples are arrays and function pointers. To be consistent with that style, you would use "Ctype *foo", not "Ctype* foo" or "Ctype * foo". 2. The point about multiple decls is well made, e.g. "Ctype *foo, *bar". This illustrates the real nature of the "*" in the decl, which argues for "Ctype *foo" for a single decl. 3. IMHO what's more important is a naming convention for pointers. I maintain 1/2 million code lines of C with heavy pointer use, and I never have dereferencing bugs, because we use such a convention: "p_" prefix on names to indicate a pointer ("pp_" for double pointers, etc.), i.e. "p_foo" in the example above. (Another convention is a suffix of "P", i.e. "fooP" in the example.) Let's say you see "p_foo = *pp_bar;" in some code. Once your eyes learn to balance the levels using the convention, you can see that this is correct, whereas "p_foo = **pp_bar;" looks wrong. Stephen F. Heffner, President | Phone: +1(480)626-5503 ------------ | Fax: +1(480)626-7618 Pennington Systems Incorporated | Email: Heffner@Pennington.com 8655 East Via de Ventura, Suite G200 | Web: http://WWW.Pennington.com Scottsdale, Arizona 85258-3321 USA | XTRAN: A software engineering meta-tool
S
Stephen F Heffner
@Stephen F Heffner