Answers for "C++ passing function arguments to a thread"

C++
0

C++ passing function arguments to a thread

void randVals(int val, char* str, double dblval)
{
  cout << val << " " << str <<" " << dblval << endl;
}

/**************************************************/

char* str = "Hello World!";

thread thread1(randVals, 3, str, 7.7);

if (thread1.joinable())
{
thread1.join();
}
Posted by: Guest on March-19-2022

Code answers related to "C++ passing function arguments to a thread"

Browse Popular Code Answers by Language