Lets say i have a class such as
class c{...
void *print(void *){ cout << "Hello"; }
}
And then i have a vector of c
vector<c> classes; pthread_t t1;
classes.push_back(c());
classes.push_back(c());
Now i want to create a thread on c.print();
And the Following is Giving me problem
pthread_create(&t1, NULL, &c[0].print, NULL);
Error Ouput: cannot convert ‘void* (tree_item::)(void)’ to ‘void* ()(void)’ for argument ‘3’ to ‘int pthread_create(pthread_t*, const pthread_attr_t*, void* ()(void), void*)’