put function on an another thread c++ code example
Example: c++ put a function in a other thread
void task1(std::string msg)
{
std::cout << "task1 says: " << msg;
}
std::thread t1(task1, "Hello");
void task1(std::string msg)
{
std::cout << "task1 says: " << msg;
}
std::thread t1(task1, "Hello");