Answers for "C++ Initializing a thread with a class/object"

C++
0

C++ Initializing a thread with a class/object

class myFunc
{
public:
  void function() (/* No Parameters */)
  {
    cout << "myFunc object." << endl;
  }
};

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

myFunc myFunc1;

thread thread1(myFunc1);

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

Code answers related to "C++ Initializing a thread with a class/object"

Browse Popular Code Answers by Language