I have an array like this
uint8_t mArray[8] = {0xAA,0xBB,0xCC,0xDD,0x00,0x11,0x22};
I send to this array to two different function like this:
In main.c
func1(2,(uint8_t*)&mArray);
In function.c
void func1(uint8_t pos, uint8_t* mArray)
{
....
// When I print the mArray here I get correct value
func2(pos,&mArray);
}
When I print to mArray in func1 I get aa bb cc dd 00 11 22 00
void func2(uint8_t pos, uint8_t* mArray)
{
uint16_t i;
for(i = 0 ; i < 8; i++)
{
printf("%02x ",mArray[i]);
}
....
}
When I print mArray here I get meanless number e8 ff 02 20 84 26 00 20
Where is the problem, why the array does not passing second time ?