title: defining a fixed size array in a struct
body: <p>I have defined a struct in side a class. One of the members is an array with a given size.</p>
  
  <pre><code>class foo {
  private:
    int N;
    struct entry {
      uint64_t pc;
      uint64_t offset;
      bool pattern [N];
    };
  public:
    void bar()
    {
     entry en;
     en.pc = 1;
     en.offset = 2;
     en.pattern[en.pc] = 1;
    }
  };
  </code></pre>
  
  <p>But the error is</p>
  
  <pre><code>error: invalid use of non-static data member ‘N’
  </code></pre>