From 45e779c56f404e03bf04b05808e2fd139091db50 Mon Sep 17 00:00:00 2001 From: "Simon V. Lejel" Date: Sat, 10 Feb 2024 14:26:45 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Impore=20formatting=20of=20outpu?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/main.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/client/main.cc b/src/client/main.cc index 9ef0cb8..29a6657 100644 --- a/src/client/main.cc +++ b/src/client/main.cc @@ -38,15 +38,16 @@ int main() { Message message; cout << "Type message to server: "; cin >> message.content; - cout << endl; - message.username = "Client 1"; if (strcmp(message.content, "exit") == 0) { break; } - cout << "Sending message to server as user: " << message.username << endl; - send(clientSocket, message.content, strlen(message.content), 0); + cout << endl; + message.username = "Client 1"; + + send(clientSocket, message.toString().data(), + strlen(message.toString().data()), 0); } close(clientSocket);