Recent submissions

Comment · 3 years ago
Thanks for all the great answers. The inconsistency between pointer deceleration and dereference syntax was what got me. :)
Comment · 3 years ago
Thanks for submitting this. I'm teaching myself C so these high level overviews are super useful for improving my intuition. In the following example, shouldn't there be an asterisk * before the data argument in the getData function call? The way I understand it the function is expecting a pointer so you would need to pass it a pointer of the data object.

> "If you want to “return” memory from a function, you don’t have to use malloc/allocated storage; you can pass a pointer to a local data:

void getData(int *data) { data[0] = 1; data[1] = 4; data[2] = 9; }

void main() { int data[3]; getData(data); printf("%d\n", data[1]); } "

Comment · 4 years ago
Comment · 4 years ago
Unrelated to the contents on the article but the wording of the title made me think that the Harvard Professor crashed into the Pacific Ocean. You might want to consider clearing it up.
Comment · 4 years ago
Obligatory "there truly is an xkcd for everything."

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton