title: Fast way to replace elements in array - C
body: <p>Let's say we have an array of ints like this:</p>
  
  <pre><code>const int size = 100000;
  int array[size];
  //set some items to 0 and other items to 1
  </code></pre>
  
  <p>I'd like to replace all items that have value of 1 with another value, for example 123456. 
  This can be trivially implemented with:</p>
  
  <pre><code>for(int i = 0; i &lt; size ; i++){
      if(array[i] != 0) 
          array[i] = 123456;
  }
  </code></pre>
  
  <p>Out of curiosity, is there a faster way to do this, by some kind of x86 trickery, or is this the best code for the processor?</p>