title: Array inside a Struct in C++
body: <p>I've been trying to figure out how to add an array into a struct... a struct of ints for example would look like this:</p>
  
  <pre><code>struct test{
      int a;
      int b;
      int c;
  } test = {0,1,2};
  </code></pre>
  
  <p>but if I want to have an array for example:</p>
  
  <pre><code>struct test{
      int a;
      int b;
      int c;
      int deck[52];
  } test;
  </code></pre>
  
  <p>is this doable? the initialization of the deck (of cards) happens in a different function. when I do it like this, I don't get an error in the <code>struct</code> but I get it when I try to use it... for example if I do this <code>test.deck[i] = 1;</code> it gives me this error:</p>
  
  <pre><code>Error C2143 Syntax Error missing ';' before '.'
  </code></pre>
  
  <p>if I were to use <code>a</code> , I could write <code>test.a = 1;</code></p>
  
  <p>Could anyone write a simple struct where a variable in it is an array and then just use it for a simple command?</p>