title: Using a struct variable as a formal parameter
body: <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  void input(partsType inventory[100]&amp;)
  {}
  
  int main()
  {
     struct partsType
     {
  
        string partName;
        int partNum;
        double price;
        int quantitiesInStock;
     };
     partsType inventory[100];
  }
  </code></pre>
  <p>I am trying to use a struct variable as a formal parameter. Later I will pass the variable by reference.</p>
  <p>Currently, I am getting the error</p>
  <pre><code>declaration is incompatible, and `partsType` is undefined. 
  </code></pre>