title: HOW to write program that scan string of strings with pointers
body: <p>I'm trying to write a program that asks from the user to enter couple of names (in this case 3, check out my define), the program, with functions <code>scan_names</code> and <code>print_names</code> would scan the names and print them, no matter what I do I don't succeed with it :(</p>
  
  <p>This is the exception I get:
  "Exception thrown at 0x0FD6FB7C (ucrtbased.dll) in Magshimim_EX175.exe: 0xC0000005: Access violation reading location 0x00616161."</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  #define LINE 3
  #define LENGH 10
  
  void print_names(char* names[LENGH], int line)
  {
      printf("\nYour names are:\n");
      for (size_t i = 0; i &lt; line; i++) {
          puts(names[i]);
      }
  }
  
  void scan_names(char* names[LENGH], int line)
  {
      for (int i = 0; i &lt; line; i++) {
          printf("\nEnter name %d:  ", i + 1);
          fgets(names[i],LENGH,stdin);
      }
  }
  
  int main(void)
  {
      char names[LINE][LENGH] = { NULL };
      scan_names(names, LINE);
      print_names(names, LINE);
  }
  </code></pre>