Passing a structure in a socket..!
So I'm trying to teach myself to write programs for unix in c. I am currently creating a program, and I need to pass a struct through a socket, but I can't figure out how.
The struct I want to pass has two types in it, one enum and one union of two other structs. These two other structs each contain an int and a char variablename array.
gcc won't let me just pass the struct using write(pipefd, struct, size_of_struct) since the struct is not a char buffer. So that's my question...how does one go about passing a struct?