how to give threads a method for there function cppp code example
Example 1: multiple threads cpp
#include <iostream>
#include <threads>
#include <vecotr>
std::vector<std::thread*> threads;
for(int i = 0; i < x; i++)
{
threads.push_back(new std::thread(func));
}
Example 2: thread c++ member function
myThreads[i] = std::thread(&Car::start, myCar);