#include <iostream>#include <thread> int main() { using std::thread; using std::cout; using std::endl; thread th([](){cout << "Hello from other thread" <<endl;}); cout << "Hello from main thread" << endl; th.join(); return 0;}
Standard input is empty
/home/LJsRmU/ccwt9alT.o: In function `main': prog.cpp:(.text.startup+0x8): undefined reference to `pthread_create' collect2: error: ld returned 1 exit status
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!