If I have the following: -
struct foo
{
int a;
int *b;
} bar;
void baz(struct foo qux)
{
}
Did I understand correctly that passing barin baz()causes the local copy to barbe pushed onto the stack? If so, which copy? in C ++, I assume that it will call the copy constructor or copy constructor by default, but I really don't know how this will work in C.
Does C have the concept of a default copy constructor and does it have a name? Is there anything you can do to make a deep copy? (Hypothetically). The only way I could think of is to make a deep copy and then pass it to the function.
, foo, , . , , , . , ; ?