title: C store multiple int arrays into another array via pointer
body: <p>I'm sorry if this is confusing....So far I'm converting a decimal number into binary. While doing this, i store the digits for the binary representation into an int array. </p>
  
  <p>EX: for the number 4. (this is done in dec2bin below)</p>
  
  <pre><code>    temp[0] = 1
      temp[1] = 0
      temp[2] = 0
  </code></pre>
  
  <p>i would like to store this array into another array (say BinaryArray) that will contain multiple 'temp' arrays.</p>
  
  <p>I would like the BinaryArray to declared main, passed to dec2bin, and the save a copy of the current temp array. then go to the next number.</p>
  
  <p>I'm having trouble with figuring out the pointers and what not needed for this. If someone could help me with how to declare the needed array in main and how add to it from dec2bin.</p>
  
  <p>Thanks!
  Main: </p>
  
  <pre><code>    #include &lt;stdio.h&gt;
      #include &lt;stdlib.h&gt;
      #include &lt;string.h&gt;
  
      int main()
      {      
  
        void dec2bin(int term, int size);
  
        int size, mincount;
        int * ptr;
        int x;
        x=0;
  
        scanf("%d %d", &amp;size, &amp;mincount);
        printf("Variables: %d\n", size);
        printf("Count of minterms: %d\n", mincount);
  
        int input[mincount+1];
  
        while(x &lt; mincount){
          scanf("%d", &amp;input[x]);
          x++;
        }
        x = 0;
  
        while(x &lt; mincount){
          dec2bin(input[x], size);
  </code></pre>
  
  <p>Dec2bin : </p>
  
  <pre><code>    #include &lt;stdio.h&gt;
      #include &lt;stdlib.h&gt;
      #include &lt;string.h&gt;
      #define SIZE 32
  
      void
      dec2bin(int term,int size){
        int i, j, temp[size], remain, quotient;
        quotient = term;
        i = size-1;
        // set all temp to 0
        for(j=size-1;j&gt;=0; j--){
          temp[j] = 0;
          }
  
        //change to binary
        while(quotient != 0){
          remain = quotient % 2;
          quotient/=2;
          if(remain != 0){
            temp[i] = 1;
           } else {
            temp[i] = 0;
           }
           i--;
          }
  
          //print array
          for(i=0; i&lt;size; i++)
            printf("%d", temp[i]);
  
          printf("\n");
      }
  </code></pre>