title: Invalid use of flexible array member
body: <p>I've got a problem when i'm programming.</p>
  
  <pre><code>struct skills {
      int SnCrypt;
      char* Soutput;
      int Soptind;
      int Sdecrypt;
      int Sargc;
      char* Spassword;
      char *const Sargv[];
  };
  
  struct skills* initSkills(int nCrypt, char* password, char *const argv[], char* output, int optind, int decrypt, int argc) {
      struct skills* skill;
      skill-&gt;SnCrypt = nCrypt;
      skill-&gt;Spassword = password;
      skill-&gt;Sargv = argv;
      skill-&gt;Soutput = output;
      skill-&gt;Soptind = optind;
      skill-&gt;Sdecrypt = decrypt;
      skill-&gt;Sargc = argc;
  
      return skill;
  }
  </code></pre>
  
  <p>And gcc tell me </p>
  
  <blockquote>
    <p>invalid use of flexible array member </p>
  </blockquote>
  
  <p>for the line <code>skill-&gt;Sargv = argv;</code>.</p>
  
  <p>I don't understand how could I point the value pointed by <code>char *const argv[]</code> by an other pointer? I'm aware that I surely must <code>malloc</code> the <code>skill-&gt;Sargv</code> pointer but how? Like this <code>(char const*)malloc(sizeof(argv[]))</code>?</p>