I'm doing a small client/server project as a final project in a C++ course. We are handed some classes that take care of communication (using sys/socket.h) and we can basically do connection->send(byte)
to send one byte of data.
Say I have a string that I want to send. How do I make sure an 'a' is interpreted as an 'a' when sent from client to server or vice versa? Since the standard isn't saying anything about char defaulting to unsigned or signed I don't know how to handle it.
I had some idea that I could subtract std::numeric_limits<char>::min()
on each end but I'm not sure it is a good one.