type* name;
ortype *name;
not allowed:type * name;
discuss
those of us with a clue have already moved on to superiorname typelanguages
>>61715407
>pass by value
yea no
type* name is the most logical. the type being declared is "pointer to type" so it makes sense to group them together. the second one is acceptable. the third one makes me want to vomit all over my keyboard.
>>61715477
this
>>61715407
those who don't have a clue moved on to*
>>61715492
this
>>61715382
>type* name;
How it SHOULD have been, if C devs weren't retarded.
>type *name;
How it actually is. You'll shoot yourself in the foot sooner or later if you use anything but this.
>>61715642
Why would i shoot myself in the foot if im not using type *name?
>>61715691type* a,b;
type *name1, *name2;
ortype* name1, *name2;
?
>>61715704
>>61715706
oh i see.
but isnt that bad style anyway?type* name;
type* eman;
looks a lot cleaner dont you think?
>>61715797
It doesn't when you have more than 3 variables.
>>61715382
Both forms have the same result. Chose the one to your liking.
>>61715492
i agree but then declaring multiple pointers in one line becomes uglyint* pt1, *pt2, *pt3
typedef int* intPtr;
>>61715920
yes yes
>>61715382
type
*
name
;
>>61715382std::shared_ptr<type> name;
std::unique_ptr<type> name;
>>61717480
smart lad