Why Nostr? What is Njump?
2024-07-11 13:58:07

nytpu on Nostr: Just learned possibly the most cursed C fact IMO: array[i] is equivalent to *(array + ...

Just learned possibly the most cursed C fact IMO: array[i] is equivalent to *(array + i) per the spec, which means i[array] works exactly the same, since the + operator is commutative. It also works for multidimensional/nested arrays and the “outside” index doesn't even need to be a symbol, so you can even do things like 0[array]1, equivalent to array[0][1] and *(*(array + 0) + 1). This is a new level beyond pointer decay, which generally makes sense even if it's irritating

Per: gemini://foo.zone/gemfeed/2024-07-05-random-weird-things.gmi
Author Public Key
npub13msuj9j46g097smcjp8dzcnzzdgnh9vzkg9448ymgdqxp6fs94hqkhpn79