The size of the pointer: sizeof(myPointer)
(Equal to sizeof(uint8_t*)
)
The size of the pointee: sizeof(*myPointer)
(Equal to sizeof(uint8_t)
)
If you meant that this points to an array, there is no way to know that. A pointer just points, and cares not where the value is from.
To pass an array via a pointer, you'll need to also pass the size:
void foo(uint8_t* pStart, size_t pCount);
uint8_t arr[10] = { /* ... */ };
foo(arr, 10);
You can use a template to make passing an entire array easier:
template <size_t N>
void foo(uint8_t (&pArray)[N])
{
foo(pArray, N); // call other foo, fill in size.
// could also just write your function in there, using N as the size
}
uint8_t arr[10] = { /* ... */ };
foo(arr); // N is deduced