online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <future> #include <iostream> #include <string> #include <thread> std::string GetLineAsync() { std::string input; std::getline(std::cin, input); return input; } int main() { auto future = std::async(std::launch::async, GetLineAsync); // future is of type 'std::future<std::string>' while (future.wait_for(std::chrono::seconds(0)) != std::future_status::ready) { std::cout << "Waiting for input (doing something else in the meanwhile)..." << std::endl; std::this_thread::sleep_for(std::chrono::seconds(1)); // This thread job } // Input is ready: const std::string input_c = future.get(); std::cout << "Input: " << input_c << std::endl; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue