我正在尝试使用 pthread_create() 但它总是给我这个错误从void*
到的无效转换void* ( * )(void*)
此错误在第三个参数中。有人可以帮我解决这个错误吗?
void Print_data(void *ptr) {
cout<<"Time of Week = " <<std::dec<<iTOW<<" seconds"<<endl;
cout<<"Longitude = "<<lon<<" degree"<<endl;
cout<<"Latitude = "<<lat<<" degree"<<endl;
cout<<"Height Above Sea = "<<alt_MSL<<" meters"<<endl;
}
int call_thread()
{
pthread_create(&thread, NULL, (void *) &Print_data, NULL);
return 0;
}