Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Excellent point. I wasn't trying to discount your comment, but your statements here now are clear to me.

As I was implementing a dynamic array (vector) last night in C, I thought about the vector_get method that would implemented. It would first check the bounds that it receives as the second arguments (first is struct vector_t instance), and it would only return if that index is less than the current size of the vector. If the bounds is out of reach, the program aborts.

This was a great example of abstraction in C that I found really enjoyable to write.



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

Search: