BizarrePsycho:
And I believe the default for passing a struct into a function is pass by reference.
No, it isn't. Try this:
struct foo {
int a;
int b;
};
void bar (struct foo x)
{
x.a = 42;
}
void setup ()
{
struct foo y;
y.a = 1;
y.b = 2;
Serial.begin (115200);
Serial.println (y.a);
bar (y);
Serial.println (y.a);
exit (0); // little jest there
}
void loop () {}
That prints:
1
1
Now change bar to be:
void bar (struct foo & x)
That prints:
1
42
So the default, as with all other arguments, is call by value.