![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Expert Programmer
Join Date: Dec 2004
Posts: 794
Rep Power: 4
![]() |
The Endless Pointer Declaration War
type* foo; type *foo type * foo
__________________
Few people deserve to be compared to (Rush) Limbaugh, most of them were convicted at the Nuremburg trials. --WilliamSChips on Slashdot |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
Join Date: Oct 2005
Location: Melbourne, Australia
Posts: 126
Rep Power: 4
![]() |
type * foo Though, if I am declaring more than one, it usually goes like so: type * foo, *bar, *sna; ![]()
__________________
it's ironic considerate rarity patron of love higher knowledge engulfs me... |
|
|
|
|
|
#3 |
|
Hobbyist Programmer
Join Date: Apr 2006
Posts: 155
Rep Power: 3
![]() |
I usually use
type *foo; |
|
|
|
|
|
#4 |
|
Programmer
|
type *foo; type* foo |
|
|
|
|
|
#5 |
|
Hobbyist Programmer
Join Date: Jun 2006
Location: Ireland
Posts: 152
Rep Power: 3
![]() |
type* foo
__________________
Visit my website BinaryNotions. |
|
|
|
|
|
#6 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Since I predate C++, I tend to use "int *whatsis"; however, I tend to use "int& whatsis." Quite frankly, anyone who would go to war over the issue should get a life.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#7 |
|
Professional Programmer
Join Date: Jun 2005
Location: India, The great.
Posts: 435
Rep Power: 4
![]() |
I've been using type *var; till now. But I'm thinking of switching to type* var as a lot of experts tend to like it.
__________________
PFO - My daily dose of technology. |
|
|
|
|
|
#8 |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
I tend to use type* for the same reasons as free-zombie. However, IIRC:
int a, *b; int a; int* b |
|
|
|
|
|
#9 |
|
Professional Programmer
![]() Join Date: Sep 2005
Posts: 419
Rep Power: 4
![]() |
I wasn't aware there was a war about this. Whoever argues such a silly point really does need to get a life. Oh, and my preference matches Dawei. I use "int *p" and "int& r".
__________________
Even if the voices aren't real, they have some pretty good ideas. |
|
|
|
|
|
#10 |
|
Hobbyist Programmer
Join Date: Jan 2006
Location: Menidi, Athens, Greece
Posts: 243
Rep Power: 3
![]() |
'War'? Never heard of such a thing in pointers or pointer declarations...
![]() I prefer 'int *p' and 'int &r'. In my head, for some reason 'int * p' causes problems. In ObjC though, I sometimes use 'NSString* str', but that happens in very specific and few places. I think that this is a matter of preference and only that. The topic of this thread is really exaggerating...
__________________
Project::Soulstorm (personal homepage) |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|