referencing arrays

Just a quick question because i wasn't sure how 32b or higher OSs define pointers.
My question is does a pointer refer to a 4byte memory block, or 1 specific byte.

1
2
3
//What would this return
char ar[8] = {33};
(&ar[0] == &ar[1])
Last edited on
My question is does a pointer refer to a 4byte memory block, or 1 specific byte.
It depends on the pointer's type.

A char is one byte. A pointer to a char points to 1 byte.

An int16_t is two bytes. A pointer to an int16_t points to two bytes.
Topic archived. No new replies allowed.