title: how do I input values into a structure using pointers?
body: <p>I have a small problem with this program I'm writing, I'm trying to input data into a structure using a pointer but the compiler just gives me an error stating:  "dereferencing pointer to incomplete type"</p>
  
  <p>the function of the program is simple:
  a program that uses functions to input data into a structure using pointers</p>
  
  <p>heres the code:
  the main function simply calls the input function and passes the structure pointer as an argument</p>
  
  <pre><code>void input(struct test *ptr)
  {
  printf("Enter: \n");
  fflush(stdin);
  scanf("%s",&amp;ptr-&gt;entry);
  
  }
  
  void print(struct test *ptr)
  {
  
  }
  
  int main()
  {
      int counter;
      struct test
      {
          char entry[20];
  
      }p[4];
      struct test *ptr=p;
      ptr=&amp;p;
  
      for(counter=0;counter&lt;=4;counter++)
          {
              input(ptr);
              ptr++;
          }
      return 1;
  }
  </code></pre>
  
  <p>The print function is still empty.</p>