if I meet a struct where there is a pointer to a function, how may I make a deep copy of this
I have already reviewed Deep copy of a pointer function. But the thing is that I want to make a socket and send it to other machines. The solution purposed by this discussion will not work. Since the memory where store this function will not exist in the new machine.
E.G code:
struct A {
int (*f)()
};
int func() {
return 10;
}
int main() {
struct A;
A.f = &func;
// how can I send a socket includes the information of A
}