Есть такой код:
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
#include <string.h>
void * thread_func( char arg[])
{
printf("%s", arg);
}
int main()
{
int id;
pthread_t thread1;
printf("\n--- start first thread--\n");
pthread_create(&thread1, NULL, thread_func("1"), &id);
printf("\n--- end of start first thread--\n");
printf("\n--- start second thread--\n");
pthread_create(&thread1, NULL, thread_func("2"), &id);
printf("\n--- end of start second thread--\n");
printf("Done\n");
}
Ошибка сегментирования (сделан дамп памяти)
Конкретно в приведеном коде где(какая) ошибка?