On 29/09/2012 17:17, V G wrote: > This is an opinion question. I am curious as to what you all think is a > good way to do this: > > In C/C++, what is your preferred way or declaring pointers? > > A) int* p; > B) int *p; > C) int * p; > > I think it should be A because it's logical and the C/C++ compiler > considersint*to be the type, and the syntax is ; > > However, I see B a lot in code, and it doesn't make sense to me. Also, > function prototypes are usually written like so: > > void myFunction(int*, int*, char*); with the asterisk close to the type. There is no name here (which in a prototype is not necessary). Another=20 place you see A include casts (int*), but once again that's without a name. > Note that when doing this: > > int* x, y; > > Type type of x is int* whereas the type of y is int. To make the type of > both of them int*, one must do: For this exact reason my opinion is that your syntax B is the most=20 sensible and human readable. I think that things which make code more=20 readable are far more important than those which make code "right". The=20 compiler will work with either. David --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .