Hey there.
I am doing some c program that simulate a call center using threads. In the print function it gives me this error: aggregate value used where an ineteger was expecter. I already tried to make a cast to int but it still give me this error.
The variable var_telefonista was declared global like an sem_t.
void *print(void *nume)
{
while(1){
pthread_mutex_lock(&mutex);
int x = (int)var_telefonista;//total number of call operators
printf("Estão a decorrer %d chamadas\n",var_telefonista);
printf("O número de operadores livres é %d\n",((int)nume - x));// ->ERROR is here!!
printf("Chamadas em espera %d\n",espera);
pthread_mutex_unlock(&mutex);
sleep(5);
}
If some know any solution plz tell me.
Thanks