Article View: comp.os.ms-windows.programmer.tools.mfc
Article #15Re: Newbie pointer question
From: NetNinja
Date: Thu, 14 Sep 1995 21:05
Date: Thu, 14 Sep 1995 21:05
23 lines
1240 bytes
1240 bytes
vashist@tcsmgmt.com (Vashist Worah) wrote: >This may seem trivial to veterans here, but I am trying to figure out >what in the world is the difference in declaring pointers in the two >different manners illustrated below (VC++ 2.2): >1) double* x >2) double *x >Of course, referencing pointers in the manner > *x >yields the value of the variable whose address is stored in the pointer Well, there is no difference. But, if you are declaring multiple variables the second style is preferred because it causes less confusion. if you say 'double* x, y' that does not mean y is a double pointer, y is still just a double since the '*' goes with the variable x, hence it is always better to put it nearer to the variable than the type
Technical Details
Message-ID:
<43a4pb$8b4@shellx.best.com>Path:
arc1-ca.pugleaf.net!shellx.best.com!usenetReferences:
<9a7cb$d1625.8d@news.tcsmgmt.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!shellx.best.com!usenet From: netninja@svpal.org (NetNinja) Newsgroups: comp.os.ms-windows.programmer.tools.mfc,comp.os.ms-windows.programmer.win32,comp.lang.c,comp.lang.c++ Subject: Re: Newbie pointer question Date: Thu, 14 Sep 1995 21:05:24 GMT Organization: Dark Scavengers Message-ID: <43a4pb$8b4@shellx.best.com> References: <9a7cb$d1625.8d@news.tcsmgmt.com> NNTP-Posting-Host: cypher.vip.best.com X-Newsreader: Forte Free Agent 1.0.82