file 1:
void foo::start(){
byte A[]={1, 2, 3};
my_fn(&A[0]);
}
file 2:
void my_fn(byte A[]){
...//do something with A
}
Since A is a local variable, passing A to my_fn should result in bad_pointer in file 2. However, I'm able to access value of A in file 2. Are there any potential problem with this code?
void foo::start(){
byte A[]={1, 2, 3};
my_fn(&A[0]);
}
file 2:
void my_fn(byte A[]){
...//do something with A
}
Since A is a local variable, passing A to my_fn should result in bad_pointer in file 2. However, I'm able to access value of A in file 2. Are there any potential problem with this code?