I do my best to expalin what I'm trying to develop:
I have developed a function2 into a library which returns the address of an array.
uint16_t * readArray(void) { uint16_t array[5] = {1, 2, 3, 4, 5}; return array; }
Another function1 from the same library has to store this address into a pointer that is passed as argument. This function does not return nothing, but the address need to be save in the pointer.
void readAddress(uint16_t *pointer_) { pointer_ = readArray(); }
From 'main' function, values from the array need to be printed.
uint16_t *values; int main(void) { ... readAddres(values); print(values); // This function prints the complete array ... }
- Function declarations are omitted conciously (library.h).
What I have found is doing so, the value stored in 'pointer_' is not the array's address.
This is a pointer issue, and I would be pleased if someone could help me to understand how to develop a situation like this.
KR!