I have one question about the static variable in C language. For example, there are two files, one is "Action.c" and another is "Result.c"
[In Action.c File] `
static uint8_t actionResult[10] = {0x00};
void getActionResult (uint8_t** resultPtr)
{
*resultPtr = actionResult;
}
[In Result.c]
void main (void)
{
uint8_t* getResultPtr = NULL;
getActionResult(&getResultPtr);
}
I want to know this is legal method to get value from "Action.c" file or not. And also want to know transfer static variable address to other file is bad idea or not?
Thank you so much.