title: Storing user input into string array in C
body: <p>I'm writing a program that is supposed to take in a list of names from the user, store them in an array, and then search through the list to check and see if the next name the user enters is part of the original list of names. </p>
  
  <p>The issue I'm having is that when I go to enter a list of names, it only saves the last name entered into the list. Here is the part of code where I have problem:</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;conio.h&gt;
  #include&lt;string.h&gt;
  
  #define MAX_NAMELENGTH 10
  #define MAX_NAMES 5
  void initialize(char names[MAX_NAMES][MAX_NAMELENGTH]);
  
  int main()
  {
      char names[MAX_NAMES][MAX_NAMELENGTH];
  
      initialize(names);
      getch();
      return 0;
  }
  
  void initialize(char names[MAX_NAMES][MAX_NAMELENGTH])
  {
      int i,Number_entrys;
  
      printf("How many names would you like to enter to the list?");
      scanf("%d",&amp;Number_entrys);
  
      if (Number_entrys&gt;MAX_NAMES) {
         printf("Please choose a smaller entry");
      }   
      else {
          for (i=0; i&lt;Number_entrys; i++){
              scanf("%s",names[i]);
          }   
      }   
  
      printf("%s",names); 
  }
  </code></pre>