How to send and receive an array of character pointers char *argv from server to client in linux socket programming
I have a char * array like
char *options[n] ; // n = 2 just for example . options = "How to"; options = "Send";
How do I send "options" from server to client , using just one function call like send. Since the prototype of send is like this int send(int sockfd, const void *msg, int len, int flags); and receive is int recv(int sockfd, void *buf, int len, int flags); I am not sure how to cast "options" such that send and receive can take place in one function call.
You have to send the actual character strings. The pointers are memory addresses on you machine and are only accesable/meanaingful inside your program.
Even if the client and server were on the same machine the OS would block any attempt to access the client programs memory.