I'm working with unix sockets, and I can send() and recv() data when my buffer is of type char (ie. sending and receiving strings). I used Beej's guide to sockets, and the examples used were for send'ing/recv'ing strings.
Now I want to send/recv data of different types in one message.
For example, say in one message I want to send an integer, a string, a double and a float.
How should I go about doing this? More specifically, of what type should my message 'buffer' be?
The prototypes for send and recv:
int recv (int socket, void *buffer, size_t size, int flags)
int send (int socket, void *buffer, size_t size, int flags)
I don't have too much experience with C/C++ and pointers, so this is probably a noob question.
If anyone can guide me in the right direction, I'd really appreciate it. Thanks