Open guitronimo opened 3 months ago
After some reasearch this appears to be a std::cin problem.
Solution appears to be:
case 1: { // send message to server
std::cout << "enter message to send:\n";
std::string message;
std::getline(std::cin, message); //std::cin >> message; // Bugged in g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
pipe_ret_t sendRet = client.sendMsg(message.c_str(), message.size());
if (!sendRet.isSuccessful()) {
std::cout << "Failed to send message: " << sendRet.message() << "\n";
} else {
std::cout << "message was sent successfuly\n";
}
break;
}```
Hey yall!
Learning C++ at the moment and i found that this a great project to build on to! Thanks for that.
I come a cross an issue that i dont understand.
When sending "Hello Wolrd" as message i get:
Its like as if it jumps back automatically to menu on space characters and thinks that next input is "World", where it expects a number again.
Can you point me towards the code that i can check debugging?
Thx