[gameprogrammer] Re: A Note on C Programming Style

I think it all comes down to a matter of preference.

I used to prefer the char* p method, simply because it
made it clear in my head that I was creating a
character pointer.  In the same sense you could look
at it the other way around, char *p, and say that you
are creating a char which you can access by
dereferencing p (*p).  In the end, I started teaching
myself to think like the second because it was the
method other people used, thus making it easier to
read their code.  Also that method seems to align
better with C's types.  There is no char pointer type
per se, there is a char type and unary operators and
dressings that allow you to point to a char.

I hope that this didn't oversimplify the situation or
confuse anyone.  Just my $0.02.

                  ~Zac



--- Robbert de Groot <zekaric@xxxxxxxx> wrote:
> He's not the only one.  
> 
> Pointers are not hard...  If you keep it simple. 
> When you start
> doing double or more referencing then people tend to
> get a little
> glassed eyed.  
> 
> --- Alan Wolfe <alan.wolfe@xxxxxxxxx> wrote:
> > 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 (:
> 
> 
>
______________________________________________________________________
> 
> Post your free ad now! http://personals.yahoo.ca
> 
> 
> ---------------------
> To unsubscribe go to
> http://gameprogrammer.com/mailinglist.html
> 
> 
> 


                
Discover Yahoo! 
Use Yahoo! to plan a weekend, have fun online and more. Check it out! 
http://discover.yahoo.com/


---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: