title: Unable to modify an array inside of a class in C++
body: <p>I am new to C++. I just wrote this program in Visual Studio Code, but I am receiving two errors which I haven't found an explanation for.</p>
  <p>This is the code:</p>
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  class net{
      public: bool isConv = false;
      public: int structure[2];
      structure[0] = 1;      
  };
  int main() {
      net n;
      cout&lt;&lt; n.structure;
      return 0;
  }
  </code></pre>
  <p>The errors I am receiving are:</p>
  <blockquote>
  <p>error: C++ requires a type specifier for all declarations&quot; in line 5</p>
  <p>error: duplicate member 'structure'&quot; in line 6</p>
  </blockquote>
  <p>I think the code believes I am trying to define a new variable called <code>structure</code> in line 6, when instead I am only trying to modify the first value of the array.</p>
  <p>The same two lines of code work fine if they are in the <code>main()</code> function, but inside the class they seem to not be working.</p>
  <p>Can anyone help me understand why I have these errors, and how to fix them?</p>