I have to print address of semaphore. I create a semaphore:
sem_t *sem = sem_open("name", O_CREAT | O_EXCL, SEM_PERMS, INITIAL_VALUE);
I know that sem_open() returns the address of the new semaphore. So I have to print address of this sem. How can I do this? I've tried something like this:
printf("address sem: %d\n",sem);
id does not work cause its sem_t pointer, have I cast it to char*?