class myFunc
{
public:
void function()(int* arr, int length)
{
cout << "Array length: " << length << "...passed to thread1." << endl;
for (int i = 0; i != length; ++i)
{
cout << arr[i] << " " << endl;
}
}
};
/************************************************************************/
int arr[7] = { 0, 1, 2, 3, 4, 5, 6 };
myFunc myFunc1;
thread thread1(myFunc1, arr, 7);
if (thread1.joinable())
{
thread1.join();
}