Search Results

Search found 1 results on 1 pages for 'user397390'.

Page 1/1 | 1 

  • static thread function access non-static class member in C++

    - by user397390
    Class Test{ int value; static void* thread_func(void* args){ value++; } void newthread(){ pthread_create(&thread_func,...); } } I'm trying to create a thread in Class Test. Therefore compiler forces me to make thread_func static. However I cannot access the non-static member "value" anymore. It says: invalid use of member 'Class::value' in static member function Is there a way around it?

    Read the article

1