title: Arrays of semaphore and mutual assignment in C
body: <p>I am trying to use semaphores in C.</p>
  
  <p>I have global variable: `sem_t array[5];'</p>
  
  <p>And local <code>sem_t MyArray[2];</code> in a function.</p>
  
  <p>I initialise my semaphores.</p>
  
  <pre><code>for(i = 0; i &lt; 5; i++)
      sem_init(&amp;array[i], 0, 1);
  </code></pre>
  
  <p>I want to assign 2 of 5 semaphores from array to MyArray. So <code>MyArray</code> and <code>MyArray+ 1</code> will be for instance <code>array+3</code> and <code>array+1</code> and this are the same addresses.</p>