I've browsed the web and tried myriad combinations of parentheses, address of/dereference operators and cannot get the desired result - which is simply to see the contents of searchData printed three times in succession, with one intervening change.
Your code works on a Pololu A-StarPB 20MHz, 1.8.10, Win7.
For your little example there is really no need for pounters or references,
if you move the functionality into member functions.
(your alter_struct functions is pretty inflexible anyway)
BTW why are you using a singned quantity as an address?
Changing the " printf("-----------------------\n");" to " Serial.print("-----------------------\n");" fixes the problem. Looks like the printf() call is crashing the sketch and a buffer-full of text is never seen.
johnwasser:
Changing the " printf("-----------------------\n");" to " Serial.print("-----------------------\n");" fixes the problem. Looks like the printf() call is crashing the sketch and a buffer-full of text is never seen.
The answer! Thank you! This has been torturing me for several days. There were a handful of previous incarnations of this basic layout, and none of them worked either. The printf() must have gotten in there from a webpage fragment copy/pasted in and I never noticed it. Not suspecting an innocent print statement I concentrated my efforts on the structure/addressing side of things.
Whandall:
(your alter_struct functions is pretty inflexible anyway)
Intentionally. That one was just to prove, or disprove, the ability to change the structure contents, with known data, through a pointer passed to a function.