Hacker News new | past | comments | ask | show | jobs | submit login

5/5, but I don't think this test is very good at capturing the more obscure features of C, they all just deal with the fact that platforms have different datatypes/alignment requirements, except for the last one. I think a better example would be the following:

  int a=1, b=2, i, j;
  i = a += 2, a + b;
  j = (a += 2, a + b);
Whats the value of a, b, i, j? Hint: i and j are different.

Which begs the question, why does C have those features in the first place? The only C code where it's reasonably common seems to be in crypto algorithms.




5 and 7? If I remember the behavior of the comma operator correctly.

Anyway, I am inclined to agree that these are misfeatures. I’d almost certainly ask for it to be changed in code review.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: