Maybe because way back, in C, on processors with a dearth of registers and RAM, I somehow learned that one cannot have a function return a struct by value.
I came across some code, first ever, that did so. Essentially it was
Presumably, the "static" declaration is n/a.
I wonder what happens when size of myStuctType_t is rather large?
The code I saw this in has a struct type that is 4 uint16_t
And returning a struct that is a local would creep-out most.
(C, not C++)
I came across some code, first ever, that did so. Essentially it was
Code:
static [B]myStructType_t[/B] myFunc(void) {
[B]myStructType_t[/B] s;
// .. code here alters s
return s;
}
I wonder what happens when size of myStuctType_t is rather large?
The code I saw this in has a struct type that is 4 uint16_t
And returning a struct that is a local would creep-out most.
(C, not C++)
Last edited: