Using threads C++
I'm trying to do something very simple, I have two threads, one only prints a char in a for loop and other thread gets a char. The idea behind this is running the for loop thread and asking at the same time a char from the user, if that char is equal to 's', stops the for loop. The code is divided in two, one where I only use two std::threads, using that approach I can press a key from the keyboard while the for loop thread is running at the same time and get that char, but I don't know how to get that char value from the keyboard to use it in my for loop thread and stop it (35-57). Reading a little bit I found that I can get a return value from a thread using std::shared_future, I tried that approach (7-32) but the the problem is, the thread for loop stops to get the user's char. I'm new using threads and not sure why both approaches aren't working. Here's the code: https://code.sololearn.com/cxk8FMPNJJr9