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

Some things I like about C:

'void' means an empty parameter list, a function that returns no result, or a pointer to anything.

There is an array type, which you declare with brackets[10]. It's a real type on par with all the other real types in the language. Yet, accessing the values in an array is done exclusively via pointer arithmetic.

int foo(); declares a function with unspecified parameters, unless it is C++ where it means no parameters.

       char x[5] = "Hello"; //Is an array of 5 chars, and has no string-terminator
       char x[] = "Hello"; //Is an array of 6 chars, with string terminator.
You can declare functions that take matrices of variable size, but only in one dimension. int bar(char mat[][4][5]); Unless you're using variable-length arrays which were added to C in 1999, but aren't widely supported in compilers.



Excellent examples of C annoyances.




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

Search: