3 ms·
Yes but as I said yesterday on another post, "Yngwie Malmsteen Code". You could write it clearly by saying foo[1] instead of *(foo+1) which is what they ended
by ErroneousBosh 1y ago
Yes but as I said yesterday on another post, "Yngwie Malmsteen Code".
You could write it clearly by saying foo[1] instead of *(foo+1) which is what they ended up doing, but hey, pointer arithmetic looks complicated and clever, so let's show off with a WEEDLYWEEDLYWEEDLY guitar solo bit of code.
- quietbritishjim 1y agoWhen you are manipulating (mostly) one pointed-to element at a time, and incrementing the pointer itself in between, then that's quite a different mindset compared to using an index into an array. I agree that the subscript operator is the cleanest solution here. My point is just that I think it was missed because it's easy to overlook, rather than because, as you say, someone is deliberately trying to be too clever.