#include #include #include void* threadfunc(void* x) { std::string *s = new std::string("abc"); std::cout << "leaving threadfunc\n"; return NULL; } int main() { pthread_t thr; pthread_create(&thr, NULL, &threadfunc, NULL); pthread_join(thr, NULL); std::cout << "leaving main\n"; return 0; }