title: How to search a word in a 2d string array in C programming
body: <p>How to search for the whole word in an 2d array of strings.
  This code outputs me only the first letter of the word I enter.</p>
  
  <p>can anyone help me with this ?</p>
  
  <p>And how is that index passed in a function only the index I find form this search .</p>
  
  <pre><code>#include &lt;string.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;stddef.h&gt;
  #define PEOPLE 4
  #define LEN_NAME 30
  
  int main (void)
  {
      int i;
      char found_name;
      char name[PEOPLE][LEN_NAME]= {"John Lucas","Armanod Jonas",
                                  "Jack Richard","Donovan Truck"};
  
      printf("What name do you want to search?\n&gt;");
      scanf("\n%s", &amp;found_name);
      for (i = 0 ; i &lt; PEOPLE; i ++)
      {
          if (strchr(name[i], found_name ) != NULL)
          {
              printf( "Found %c in position %d,%s\n", found_name, i+1, name[i]);
              printf( " index of player is %d.\n",i +1);
          }
      }
      return 0;
  }
  </code></pre>