#include <pthread.h>
pthread_mutex_t* mut;
int main()
{
mut = PTHREAD_MUTEX_INITIALIZER;
}
The above code spits out error: expected expression before ‘{’ token.
#include <pthread.h>
pthread_mutex_t* mut = PTHREAD_MUTEX_INITIALIZER;
int main()
{
}
The above code spits out warning: braces around scalar initializer
So how am I supposed to initialize a mutex?