Simple pthread! C++

前端 未结 6 1143
生来不讨喜
生来不讨喜 2021-02-07 02:25

I have no idea why this doesn\'t work

#include 
#include 
using namespace std;

void *print_message(){

    cout << \"Thre         


        
6条回答
  •  春和景丽
    2021-02-07 03:26

    You should declare the thread main as:

    void* print_message(void*) // takes one parameter, unnamed if you aren't using it
    

提交回复
热议问题