j
k
j a
j l
Trash myTrash("hello"); myTrash.start();
At this point your main thread *ends* and the program ends, so the 2nd thread doesn't have an opportunity to do anything. That's why you need to wait for the 2nd thread -- by means of join().
Back to the thread
Back to the list