Mike - K8LH
Well-Known Member
Greetings guys and gals,
Could I impose on someone to help me figure out how to use a pointer to a array as a parameter for a function in a program I'm working on please? Here's what I have now;
So currently I'm not using a parameter for the function and I'm just using the owbuff[] array inside the function. How do I use a pointer as a parameter for the function so that I can specify which array to use? I'd like to be able to use function calls that look something like this - owmatch(owbuff) to send data from the owbuff[] array or perhaps owmatch(probe2id) to send data from a probe2id[] array.
TIA... Regards, Mike
Could I impose on someone to help me figure out how to use a pointer to a array as a parameter for a function in a program I'm working on please? Here's what I have now;
Code:
unsigned char owbuff[8]; // one-wire rom id buffer
Code:
/*
* One-Wire "Match Rom" function
*/
void owmatch() //
{ unsigned char i = 0; //
owrw(OwMatchRom); // send "match rom" command
do //
{ owrw(owbuff[i++]); // send 64-bit ROM ID
} while(i < 8); //
} //
So currently I'm not using a parameter for the function and I'm just using the owbuff[] array inside the function. How do I use a pointer as a parameter for the function so that I can specify which array to use? I'd like to be able to use function calls that look something like this - owmatch(owbuff) to send data from the owbuff[] array or perhaps owmatch(probe2id) to send data from a probe2id[] array.
TIA... Regards, Mike
Last edited: