title: Is there a looping problem in my c program?
body: <p>So I had this question that intrigued me:
  <a href="https://i.stack.imgur.com/nFlTX.jpg" rel="nofollow noreferrer">question</a></p>
  <p>And I tried with it I really did:</p>
  <pre><code>#include &lt;stdio.h&gt;
  typedef struct
  {
      int house_nmbr;
      int zip_code;
      char st_name[51];
      char country_name[51];
  } ADDRESS;
  typedef struct
  {
      char name[51];
      ADDRESS billing, shipping;
  } CLIENT;
  ADDRESS READ_ADDRESS()
  {
      ADDRESS *AD;
      printf(&quot;Enter the house      number.\n&quot;);
      scanf(&quot;%d&quot;, &amp;AD-&gt;house_nmbr);
      printf(&quot;Enter the street name.\n&quot;);
      gets(AD-&gt;st_name);
      printf(&quot;Enter the zip code.\n&quot;);
      scanf(&quot;%d&quot;, &amp;AD-&gt;zip_code);
      printf(&quot;Enter the country.\n&quot;);
      gets(AD-&gt;country_name);
      return *AD;
  }
  void READ_CLIENT(CLIENT *c)
  {
      ADDRESS A1, A2;
      printf(&quot;Enter the following information about your billing address:\n&quot;);
      A1 = READ_ADDRESS();
      printf(&quot;Enter the following information about your shipping address:\n&quot;);
      A2 = READ_ADDRESS();
      printf(&quot;Enter your name,\n&quot;);
      gets(c-&gt;name);
      c-&gt;billing = A1;
      c-&gt;shipping = A2;
  }
  void FILL_CLIENTS(CLIENT C[50])
  {
      int i;
      for (i = 0; i &lt; 50; i++)
          READ_CLIENT(&amp;C[i]);
  }
  void FIND_CLIENTS(CLIENT C[50], int d)
  {
      int i;
      printf(&quot;The clients with this zip code: %d have the following:\n&quot;, d);
      for (i = 0; i &lt; 50; i++)
      {
          if (C[i].billing.zip_code == d || C[i].shipping.zip_code == d)
          {
              printf(&quot;Name: %s.&quot;, C[i].name);
              printf(&quot;Billing address:\tHouse number:%d\tStreet name:%s\tZip code:%d\tCountry:%s\t\n&quot;, C[i].billing.house_nmbr, C[i].billing.st_name, C[i].billing.zip_code, C[i].billing.country_name);
              printf(&quot;Shipping address:\tHouse number:%d\tStreet name:%s\tZip code:%d\tCountry:%s\t\n&quot;, C[i].shipping.house_nmbr, C[i].shipping.st_name, C[i].shipping.zip_code, C[i].shipping.country_name);
          }
      }
  }
  int main()
  {
      int d;
      CLIENT C[50];
      FILL_CLIENTS(C);
      printf(&quot;Enter the zip code you want to find the clients holding:\n&quot;);
      scanf(&quot;%d&quot;, &amp;d);
      FIND_CLIENTS(C, d);
      return 0;
  }
  </code></pre>
  <p>However it showed me this error on the screen when I run it:
  <a href="https://i.stack.imgur.com/UDB6W.jpg" rel="nofollow noreferrer">error</a></p>
  <p>Is there a problem in the looping? Or is it in one of the functions?
  Im mostly a beginner in functions so I think I’ve done it wrong somewhere? Maybe with the pointers or elsewhere</p>