If I define a struct like:
struct tiny
{
long t;
};
will it be handled like a long
in terms of function arguments and alike,
in example would the parameter of:
void myfunc(tiny x)
{ ... }
be handled like a long
parameter by actually being pushed on the stack?
So essentially, is the tiny
struct only as large as a its sole member?
Thanks
The memory consumption of a structure is at least the sum of the memory sizes of constituent variables.
However, the compiler may add padding between the variables or at the end of the structure to ensure proper data alignment for a given computer architecture
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With