Archived
1
0
Fork 0

Add toString to Messages

This commit is contained in:
Simon V. Lejel 2024-02-10 14:25:24 +01:00
parent 63bd78aeb0
commit 9b2706ed81
Signed by: sl
GPG key ID: 6544A0430A2CFFAD

View file

@ -10,8 +10,12 @@ using std::cout, std::cin, std::endl, std::string;
int main() {
struct Message {
char * content;
string content;
string username;
string toString() {
return "User '" + username + "' wrote:\n" + content;
}
};
int clientSocket = socket(AF_INET, SOCK_STREAM, 0);