robinbloke: (Default)
[personal profile] robinbloke
[Poll #777592]

Date: 2006-07-25 09:18 am (UTC)
From: [identity profile] mattp.livejournal.com
Call me a heathen, but I don't like the syntax that C uses for pointers.

char* foo, bar, baz;, being equivalent to char *foo, bar, baz; defines one pointer and two static chars. I would prefer it to define all of the same kind - and if that were the case then I'd go for the first option. I chose the second due to the way C works.

Date: 2006-07-25 09:51 am (UTC)
From: [identity profile] robinbloke.livejournal.com
char* foo, bar is the strongest reason to the latter typing method; however heathen that I am I stick to the first one in order to indicate the type and when using char I don't use multiple declarations to be safe.

Date: 2006-07-25 05:30 pm (UTC)
From: [identity profile] deliberateblank.livejournal.com
Of course when you're using int it's perfectly safe...

Date: 2006-07-25 05:56 pm (UTC)
From: [identity profile] robinbloke.livejournal.com
Doesn't everyone know that?

Date: 2006-07-25 04:25 pm (UTC)
From: [identity profile] sunflowerinrain.livejournal.com
I chose the second due to the way C works

Indeed; C pointer syntax is not sensible.

Date: 2006-07-31 01:44 pm (UTC)
ext_8103: (Default)
From: [identity profile] ewx.livejournal.com
The logic behind it is that declaration matches use. Arguably declarator syntax could be improved by making the dereferencing operator (for both declararation and use) postfix, so you never needed to worry about precedence in declarators. It'd have to be different from *, of course, but that needn't be a problem. @ might be a reasonable choice.

Date: 2006-07-31 02:16 pm (UTC)
From: [identity profile] robinbloke.livejournal.com
I still need to read up on this...

Profile

robinbloke: (Default)
robinbloke

January 2016

S M T W T F S
     12
3456789
10111213141516
17181920212223
24 252627282930
31      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 18th, 2025 12:18 am
Powered by Dreamwidth Studios