Below is my function which takes a char array of size 2, passes it to a function and the function should return the same 2 chars back (its a bit of a convoluted process as it's talking to a hardware device). The problem is when I'm passing the char (*in)[2] into the function; When I print the elements it only displays the data in[0] and not in[1]. Not sure why. Any help appreciated.
int function(struct device *d, char (*in)[2], char (*out)[2])
{
printf("in: %c %c\n", *in[0], *in[1]); // TEST
uint16_t data = (*in[0] << 8) + *in[1];
send_request(d, IN, ECHO, data, 0, *out, 2);
printf("%s\n", *out);
return 0;
}
Thanks Bob
*in[0]likely isn't parsing how you think it is. Likewise for*in[1].