[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

type* name; or type *name; not allowed: type * name; discuss

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 19
Thread images: 4

File: 1374090121989.jpg (106KB, 764x1024px) Image search: [Google]
1374090121989.jpg
106KB, 764x1024px
type* name;

or
type *name;


not allowed:
type * name;

discuss
>>
File: gopher.jpg (27KB, 397x250px) Image search: [Google]
gopher.jpg
27KB, 397x250px
those of us with a clue have already moved on to superior
name type
languages
>>
>>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.
>>
File: dtop.gif (2MB, 600x338px) Image search: [Google]
dtop.gif
2MB, 600x338px
>>61715477
this
>>61715407
those who don't have a clue moved on to*
>>
>>61715492
this
>>
File: 1472678901863.jpg (143KB, 800x513px) Image search: [Google]
1472678901863.jpg
143KB, 800x513px
>>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?
>>
>>61715691
type* a,b;
>>
type *name1, *name2;

or
type* 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 ugly
int* pt1, *pt2, *pt3
>>
typedef int* intPtr;
>>
>>61715920
yes yes
>>
>>61715382
type
*
name
;
>>
>>61715382
std::shared_ptr<type> name;
std::unique_ptr<type> name;
>>
>>61717480
smart lad
Thread posts: 19
Thread images: 4


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.