Marty <mc******@gmail.comwrote:
I am wondering what is the difference in the placement between the 2
uses of the indirection operator? Or is there a difference?
AcDbBlockTable *pBlockTable = NULL;
AcDbDatabase* pDB = acdbHostApplicationServices()->workingDatabase();
This is answered on Stroustrup's FAQ:
http://www.research.att.com/~bs/bs_faq2.html#whitespace
In short, they are the same. It's merely a matter of style which form
you use. However, as noted on the referenced page, the confusion comes
when someone tries to declare multiple pointers with a single
declaration:
int* p1; // pointer to int
int *p2; // also pointer to int
int* p3, p4; // p3 is a pointer to int, p4 is a regular int
int* p5, *p6; // both p5 and p6 are pointers to int
Since I prefer one declaration per line, this doesn't affect me, so I
use the (int* p;) form instead of the (int *p;) form, for the reason
given on the page: (int* p;) emphasizes the type (p is a pointer to
int), versus (int *p;) which emphasizes the syntax (*p is an int).
--
Marcus Kwok
Replace 'invalid' with 'net' to reply