Function pointers are expensive, and for networking all that we really want to do is write to an array. Let's just pass that array as a reference instead to improve performance and make Networking less dependent on main.
Remove void updateDisplayWithPeerChat(char*); in main and pass messageToPrint instead. This will still maintain low coupling between Networking and Display.
Function pointers are expensive, and for networking all that we really want to do is write to an array. Let's just pass that array as a reference instead to improve performance and make Networking less dependent on main.
Remove
void updateDisplayWithPeerChat(char*);
in main and passmessageToPrint
instead. This will still maintain low coupling between Networking and Display.