title: Cause of "error: sizeof 'x' is unknown or zero" in C++?
body: <p>I am a beginer in programming. unfortunately I have a project in c++ that I don't know its problem. the program is a little long:</p>
  
  <pre><code>#include &lt;iostream.h&gt;
  #include &lt;conio.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;alloc.h&gt;
  #include &lt;time.h&gt;
  #include &lt;math.h&gt;
  #include "vdsim.h"
  void gen01dat( long, int);
  void cnv_encd(int g[], long,int,int);
  int main()
  {
  long data_len=10;
  int *out_array;
  long input_len=5;
  int g[2][3];
  
      void gen01dat(data_len,*out_array);
  
      int in_array=*out_array;
    void cnv_encd(g,input_len,in_array,*out_array);
    cout&lt;&lt;"the out_array 2 is :\t"&lt;&lt;*out_array&lt;&lt;endl;
  
  
    void gen01dat( long data_len, int *out_array ) {
  
       long t;            /* time */
  
       /* re-seed the random number generator */
       randomize();
  
       /* generate the random data and write it to the output array */
       for (t = 0; t &lt; data_len; t++)
            *( out_array + t ) = (int)( rand() / (RAND_MAX / 2) &gt; 0.5 );
  
  }
  
  void cnv_encd(int g[2][k],long input_len, int *in_array,int *out_array)
  {
  
       int m;                     /* K - 1 */
       long t, tt;                /* bit time, symbol time */
       int j, k;                  /* loop variables */
       int *unencoded_data;       /* pointer to data array */
       int shift_reg[K];          /* the encoder shift register */
       int sr_head;               /* index to the first elt in the sr */
       int p, q;                  /* the upper and lower xor gate outputs */
  
       m = K - 1;
  
       /* read in the data and store it in the array */
       for (t = 0; t &lt; input_len; t++)
            *(unencoded_data + t) = *(in_array + t);
  
       /* zero-pad the end of the data */
       for (t = 0; t &lt; m; t++) {
            *(unencoded_data + input_len + t) = 0;
       }
  
       /* Initialize the shift register */
       for (j = 0; j &lt; K; j++) {
            shift_reg[j] = 0;
       }
  
       sr_head = 0;
  
       /* initialize the channel symbol output index */
       tt = 0;
  
       for (t = 0; t &lt; input_len + m; t++) {
            shift_reg[sr_head] = *( unencoded_data + t );
            p = 0;
            q = 0;
            for (j = 0; j &lt; K; j++) {
                  k = (j + sr_head) % K;
                  p ^= shift_reg[k] &amp; g[0][j];
                  q ^= shift_reg[k] &amp; g[1][j];
            }
  
            /* write the upper and lower xor gate outputs as channel symbols */
            *(out_array + tt) = p;
            tt = tt + 1;
            *(out_array + tt) = q;
            tt = tt + 1;
  
  
            sr_head -= 1;    /* equivalent to shifting everything right one place */
            if (sr_head &lt; 0) /* but make sure we adjust pointer modulo K */
                  sr_head = m;
  
       }
  
       /* free the dynamically allocated array */
       free(unencoded_data);
  
  }
  
      return 0;
  }
  </code></pre>
  
  <p>the compiler gives this error: </p>
  
  <pre><code>error: size of 'gen01'is unknown or zero in function main()
  error: size of 'cnv_encd'is unknown or zero in function main()
  </code></pre>
  
  <p>I don't know this what does this error mean?
  thanks for your help </p>