title: Structures in C with "no member named..." error
body: <p>I'm trying to create a struct which contains the country, state, city and the name of a local shop. Unfortunately, I get this error:</p>
  
  <blockquote>
    <p>No member named bavaria in struct country</p>
  </blockquote>
  
  <p>So it seems that the error occurs here: 
  <code>strcpy(germany.bavaria.ingolstadt.westpark, "Westpark");</code></p>
  
  <p>What am I doing wrong?</p>
  
  <p>This is my complete code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  int main() {
  
      struct country {
          char countryname[100];
          struct state {
              char statename[100];
              struct city {
                  char cityname[100];
                  int postal;
                  struct shop {
                      char shopname[100];
                  } shop;
              } city;
          } state;
      } country;
  
      struct country germany;
      struct state bavaria;
      struct city ingolstadt;
      struct shop westpark;
  
      strcpy(germany.countryname, "Germany");
      strcpy(germany.bavaria.ingolstadt.westpark, "Westpark");
  
      return 0;
  }
  </code></pre>