Answer the question
In order to leave comments, you need to log in
How to implement parallel text input and output?
I'm doing a chat. In the following code, the message of the interlocutor is displayed only after I have entered text into the lines
while(true) {
string s; //мое сообщение
cin >> s; //или getline(cin, s)
cout << /* текст сообщения собеседника */;
}
cout
in the console at the same time as cin
my message is entered? In which direction of multithreading is it worth digging?
Answer the question
In order to leave comments, you need to log in
How can I make other people's messages cout to the console at the same time as cin my message?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question