News for hackers. Stuff that matters.
Re:A convenient untruth: Array notation in C is a lie by dkersten on Thursday December 22, 2016 @10:24AM (#13237796)
although it's messed up anyway as

But that's because they wanted it to be like that.

To me, this code is very unclear:

    int a, *b, c, d;
because everywhere else, multiple declarations in one statement all have the exact same type, but for some reason pointers get special treatment so that you can declare variables of type X and variables that are pointers to type X in the same statement, which just seems odd to me.

I'd be much happier if they were all strictly different and that

   int* a, b, c, d;
did, in fact, declare all four variables to be pointer to int.
Re:A convenient untruth: Array notation in C is a lie by tzs on Thursday December 22, 2016 @11:02AM (#13238128)
> [...] everywhere else, multiple declarations in one statement all have the exact same type, but for some reason pointers get special treatment so that you can declare variables of type X and variables that are pointers to type X in the same statement, which just seems odd to me.

It's not just pointers:

  int a, *b, c();
Re:A convenient untruth: Array notation in C is a lie by odbol_ on Thursday December 22, 2016 @01:20PM (#13239175)
Jesus and you guys say JavaScript is bad...
Re:A convenient untruth: Array notation in C is a lie by gpderetta on Thursday December 22, 2016 @02:41PM (#13239731)
oh, don't worry, we also say that C is bad. C++ also gets an honourable mention.
Re:A convenient untruth: Array notation in C is a lie by comex on Friday December 23, 2016 @12:12AM (#13242997)
I've occasionally written code like:

    char buffer[16], *ptr = &buffer[0]; // declare an array and a pointer into it
Re:A convenient untruth: Array notation in C is a lie by ant6n on Thursday December 22, 2016 @10:35AM (#13237896)
I'd say it's better style anyway to only ever declare multiple primitive types in the same statement.