Answers for "c++ create thread"

C++
4

c++ create threads

#include <thread>
void foo() 
{
  // do stuff...
}
int main() 
{
  std::thread first (foo);
  first.join();
}
Posted by: Guest on July-07-2020
0

c++ create thread

void task1(std::string msg)
{
    std::cout << "task1 says: " << msg;
}

std::thread t1(task1, "Hello");

t1.join();
Posted by: Guest on March-20-2021

Browse Popular Code Answers by Language