title: "&=" operation in C error
body: <p>i have an array of tam=1000 and i have to check if i receive all elements </p>
  
  <pre><code>bool ok = true;
  size_t i;
  size_t tam=1000;
  for (i = 0; i &lt; tam; i++){
      ok &amp;= vector_obtener(vec_vol, i, &amp;valor);
      if (i!=valor)      //this if was something i added to check why it wasn't working.
          printf("En i=%zu y valor=%i \n",i,valor);
      ok &amp;= (valor == i);
  }
  print_test("all good", ok);
  </code></pre>
  
  <p>vector_obtener receives the array, the position and a pointer to save the info. If the position is correct it should save the data in the pointer and return true.
   With the if i used above i checked if something was missing, but it printed from 0 to 999 as it should.</p>
  
  <pre><code>bool vector_obtener(vector_t *vector, size_t pos, int *valor){
      if (pos&gt;(vector-&gt;tam)-1 || (vector-&gt;tam==0))
          return false;
      *valor=vector-&gt;datos[pos];
      if(!*valor)
          return false;
      else
          return true;
  </code></pre>
  
  <p>Here is the print_test:</p>
  
  <pre><code>void print_test(char* name, bool result){
      printf("%s: %s\n", name, result? "OK" : "ERROR");
  }
  </code></pre>
  
  <p>EDIT: ok added. ok should be true when it enters print_test.</p>
  
  <p>PS: Sorry if im not too clear, english is not my mother language. If you dont understand something i will try to put it in another way.</p>