title: how to find duplicate string in an array of strings
body: <p>I have an array of string from which i have to find duplicate string and then remove that duplicate string like i have string</p>
  
  <pre><code> char aa[50]="Amit Hanish Mahesh Amit"
  </code></pre>
  
  <p>Now Amit is duplicate and have to remove it from string .</p>
  
  <pre><code>#include "string.h"
  main()
  {
    char x[100] = "Amit Hanish Mahesh Amit";
    char y[3][100];
    int i = 0, k = 0, j = 0, c = 0, end, t;
    int current = 1;
    while (x[i] != '\0') {
      if (x[i] != ' ') {
        y[k][j] = x[i];
        j++;
        i++;
      } else {
        // c = c + 1;
        i++;
        k++;
        j = 0;
      }
      y[k][j] = '\0';
    }
  
    for (end = 1; end &lt;= 3; end++) {
      for (t = 0; t &lt; end; t++) {
        if (strcmp(y[end], y[t]) == 0) break;
      }
      if (end == t) {
        strcpy(y[current],y[t]);
         current++;
      }
    }
    y[current] = 0;
    printf("%s",y);
  }
  </code></pre>
  
  <p>I have written a smalll routine for it .Does not seems to be worked .Any one have any suggestion where i am going wrong?</p>