&foo[bar] or (foo + bar) ?
-
That's not really a trick. It's "get me the address of the Nth array element." It's just another way of writing (foo + bar); If you insist on not mixing pointer and array ops than you'd be stuck with the very syntax you don't like in order to get the address of an array element, unless there's a 3rd way to do it I'm not considering?
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
honey the codewitch wrote:
It's just another way of writing (foo + bar);
yes I know.
honey the codewitch wrote:
If you insist on not mixing pointer and array ops
Not sure what you mean. If I create an array of pointers then I would use it like an array. If I create a pointer to memory that contains sequential blocks (regardless of type) then I would use it like a pointer. The fact that syntactically the access is the same and tradable is not a consideration.
-
honey the codewitch wrote:
It's just another way of writing (foo + bar);
yes I know.
honey the codewitch wrote:
If you insist on not mixing pointer and array ops
Not sure what you mean. If I create an array of pointers then I would use it like an array. If I create a pointer to memory that contains sequential blocks (regardless of type) then I would use it like a pointer. The fact that syntactically the access is the same and tradable is not a consideration.
jschell wrote:
Not sure what you mean.
I mean this
jschell wrote:
If I create an array of pointers then I would use it like an array. If I create a pointer to memory that contains sequential blocks (regardless of type) then I would use it like a pointer
So I think somewhere we started talking past each other.
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix