Pthreads in C. Simple example doesn’t work [closed]

This line

printf("(%s)",'Hi. It's thread number 1');

should be

printf("(%s)", "Hi. It's thread number 1");

String literals are enclosed using quotation marks ".


Also passing 1 to pthread_join() as 2nd parameter most likley invokes undefined behaviour, as it tells the function to write a value of type void * to address 1, which is not expected to be pointing to valid memory.

Leave a Comment