✨ Add toString to Messages
This commit is contained in:
parent
63bd78aeb0
commit
9b2706ed81
1 changed files with 5 additions and 1 deletions
|
@ -10,8 +10,12 @@ using std::cout, std::cin, std::endl, std::string;
|
||||||
int main() {
|
int main() {
|
||||||
|
|
||||||
struct Message {
|
struct Message {
|
||||||
char * content;
|
string content;
|
||||||
string username;
|
string username;
|
||||||
|
|
||||||
|
string toString() {
|
||||||
|
return "User '" + username + "' wrote:\n" + content;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
int clientSocket = socket(AF_INET, SOCK_STREAM, 0);
|
int clientSocket = socket(AF_INET, SOCK_STREAM, 0);
|
||||||
|
|
Reference in a new issue