title: error: initialization with "{...}" expected for aggregate object - c++
body: <pre><code>struct test
  {
      unsigned int test1;
      unsigned char test2[4096];
      unsigned int test3;
  } foo
  
  struct foobar
  {
  unsigned char data[4096];
  }
  </code></pre>
  
  <p>if i want to access the struct, i say foo.test1, foo.test2[4096], etc..
  however, when I wish to return the data present in foo.test2 in the following manner</p>
  
  <pre><code>pac.datafoo = foo.test2[4096];
  
  unsigned char data[4096] =  pac.datafoo;
  </code></pre>
  
  <p>this is the error I get:</p>
  
  <pre><code>error: initialization with "{...}" expected for aggregate object
  </code></pre>
  
  <p>what is the mistake i'm doing?</p>