beginner's question: array pointer

Joined
Feb 18, 2010
Messages
2
Reaction score
0
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top