Is there any way I can send or save a function as file? I want to do this in C++ on a Windows platform.
I assume that there is some convention between reader and sender or saver
Is it OK if I send like below?
server side:
label1:
int func1(int somevar){
int a = 1;
return somevar+a;
}
label2:
send(sockfd, label2-label1, sizeof(int), 0) //send a size first
send(sockfd, label1, label2-label1, 0); // send a "function"
thanks in advance!
No, there’s no way to do that in C++. Languages which could allow transfer of executable code include Erlang, Ruby, TCL.
Chris