3 ms·
Your impression unfortunately turns out to not be the case. You can move pointers forward and backward within an array using pointer +/- integer arithmetic or
by pklausler 11y ago
Your impression unfortunately turns out to not be the case. You can move pointers forward and backward within an array using pointer +/- integer arithmetic or (equivalently) the prefix and postfix ++/-- operators, and it's well-defined so long as you don't back up over the beginning of the array or go more than one element past the end.
See section 6.5.6, paragraph 8, of the ISO C standard, if you want the legalese. But this is pretty basic C that dates back to the beginning of the language.