title: removing duplicate integers from an array in C
body: <p>I am working on a program that removes duplicate values from an array by ordering it and then removing duplicate, consecutive values. First I execute a selection sort sorting method, and then call a function <code>removedup()</code> that modifies the array and returns the size. Then I basically print the values in the array up to that size. However, when I execute it, it only prints the original array and then a bunch of blank space. Does anyone know why this is occurring? </p>
  
  <p>My code: <a href="http://pastebin.com/uTTnnMHN" rel="nofollow">http://pastebin.com/uTTnnMHN</a></p>
  
  <p>Just the de-duplication code:</p>
  
  <pre><code>int removedup(int a[])
  {
      int i, count, j;
      count = n;
      for (i = 0; i &lt; (n - 1); i++) {
          if (a[i] == a[i + 1]) {
              for (j = 0; j &lt; (n - i); j++) {
                  a[j] = a[j + 1];
              }
              count--;
              i--;
          }
      }
      return count;
  }
  </code></pre>