[gameprogrammer] Re: A Note on C Programming Style
- From: Alan Wolfe <alan.wolfe@xxxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Thu, 5 May 2005 13:52:42 -0700
Wes you are the only person that i have talked to that sees the value
of char *p instead of char* p.
my hat is off to you (:
On 5/5/05, Wes Wannemacher <techgeek@xxxxxxxxx> wrote:
> On 5/5/05, Chris Nystrom <cnystrom@xxxxxxxxx> wrote:
> > Hi,
> >=3D20
> > Here is a small rant on C programming style from my blog, that some
> > beginners might find useful:
> >=3D20
> [snip]
> >=3D20
> > For this reason, I believe it would be better to write pointer definiti=
on=3D
> s:
> >=3D20
> > char* p;
> >=3D20
> > Note that the space is now between the * and the pointer name, and
> > also that the change has no effect on the code itself.
> >=3D20
> [/snip]
>=20
> Although you make a valid point here, there is one thing that I think
> needs to be noted about this type of notation... It can be misleading
> if you are declaring multiple variables. For instance:
>=20
> char* p, q;
>=20
> Would mean, one pointer of type char and one char variable. I know
> that it would be bad style to declare these two as such, but when you
> put the * close to the type, I can see it leading to this type of
> error later. That's normally why I put the * by the variable name
> rather than the variable type.
>=20
>=20
> ---------------------
> To unsubscribe go to http://gameprogrammer.com/mailinglist.html
>=20
>
---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html
- Follow-Ups:
- [gameprogrammer] Re: A Note on C Programming Style
- From: Etali
- [gameprogrammer] Re: A Note on C Programming Style
- From: Robert Chafer
- [gameprogrammer] Re: A Note on C Programming Style
- From: Bob Pendleton
- References:
- [gameprogrammer] A Note on C Programming Style
- From: Chris Nystrom
- [gameprogrammer] Re: A Note on C Programming Style
- From: Wes Wannemacher
Other related posts:
- » [gameprogrammer] A Note on C Programming Style
- » [gameprogrammer] Re: A Note on C Programming Style
- » [gameprogrammer] Re: A Note on C Programming Style
- » [gameprogrammer] Re: A Note on C Programming Style
- » [gameprogrammer] Re: A Note on C Programming Style
- » [gameprogrammer] Re: A Note on C Programming Style
- » [gameprogrammer] Re: A Note on C Programming Style
- » [gameprogrammer] Re: A Note on C Programming Style
- » [gameprogrammer] Re: A Note on C Programming Style
- » [gameprogrammer] Re: A Note on C Programming Style
- » [gameprogrammer] Re: A Note on C Programming Style
- » [gameprogrammer] Re: A Note on C Programming Style
- » [gameprogrammer] Re: A Note on C Programming Style
- » [gameprogrammer] Re: A Note on C Programming Style
- » [gameprogrammer] Re: A Note on C Programming Style
- » [gameprogrammer] Re: A Note on C Programming Style
- » [gameprogrammer] Re: A Note on C Programming Style
- » [gameprogrammer] Re: A Note on C Programming Style
- » [gameprogrammer] Re: A Note on C Programming Style
- » [gameprogrammer] Re: A Note on C Programming Style
- » [gameprogrammer] Re: A Note on C Programming Style
- » [gameprogrammer] Re: A Note on C Programming Style
- [gameprogrammer] Re: A Note on C Programming Style
- From: Etali
- [gameprogrammer] Re: A Note on C Programming Style
- From: Robert Chafer
- [gameprogrammer] Re: A Note on C Programming Style
- From: Bob Pendleton
- [gameprogrammer] A Note on C Programming Style
- From: Chris Nystrom
- [gameprogrammer] Re: A Note on C Programming Style
- From: Wes Wannemacher