Live data from Hacker News

Some Obscure C Features

multun.net

1–10 of 147 posts

Re: Some Obscure C Features

#6

These examples actually were more obscure than the usual list.

Yeah, I did know 3 of them[1] but the rest were completely new to me! Not that I’m an expert or anything, but I tend to enjoy reading about obscure C features. That sizeof can have side effects is... a bit crazy although the multiple compatible function declarations are horrifying.

[1] Array designators, Preprocessor is a functional language and a[b] is a syntactic sugar.

Re: Some Obscure C Features

#7
Although calling the preprocessor "functional" is being too pleasant. The C preprocessor was always a text substitution system, so macro as parameter is not that "obscure". Of course, I may have missed something subtle in the example.

It's also not clear how to use that preprocessor example.

Re: Some Obscure C Features

#9
Here is an obscure c feature:

  int main()
  {
     int a = 8;
     {
       int a = 4;
       /* a is only scoped to this block */
     }
     printf("%d", a); /* prints 8 */
  }
It is also why C++ is not a strict superset of C
Post reply on HN