title: Shift contents of array using parameters in C++
body: <p>I have been playing around with a bit of code for the past few weeks. The code is a display of the number 1. I want to essentially create a dot matrix style print out, where the 1 is continuously shifted to the right.
  Here is where I am so far:</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  /* use function to shift all characters one place to the right */
  /* use a function to declare the characters of the fiqure */
  int i, j;
  int matrix([int i][int j]);//dont think this is right
  </code></pre>
  
  <p>I have declared my variables, and the matrix with the parameters I and j </p>
  
  <pre><code>int main()
  {
      //should the matrix be a global function, therefore can be accessed by the move function?
      /* the matrix is contained within the matrix function. The goal of main, is to manipulate
      the matrix to transponse the elements to the next column*/
  
      // 8 rows and 13 columns 
  
      for (i = 0; i &lt; 8; i++)
      {
          int p = (j + 3)%13;
          for (j = p; j &lt; 13 ; j++)
          {
              matrix[i][j] = matrix[i][j + 3];
              //priting out the matrix 
              cout &lt;&lt; matrix[i][j];
          }
          cout &lt;&lt; "\n";
      }
      cout &lt;&lt; endl;
  }
  
  int matrix(int i, int j)
  /* this function sets up the matrix and returns the value of the matrix. 
  this function should simply be a display function */
  {
      int matrix[8][13] = { { 0,1,1,1,1,1,0,0,0,0,0,0,0 },
      { 1,1,1,1,1,1,0,0,0,0,0,0,0 },
      { 0,0,1,1,1,1,0,0,0,0,0,0,0 },
      { 0,0,1,1,1,1,0,0,0,0,0,0,0 },
      { 0,0,1,1,1,1,0,0,0,0,0,0,0 },
      { 0,0,1,1,1,1,0,0,0,0,0,0,0 },
      { 0,0,1,1,1,1,0,0,0,0,0,0,0 },
      { 0,0,1,1,1,1,0,0,0,0,0,0,0 } };
  
      //display the elements
      for (i = 0; i &lt; 8; i++)
      {
          for (j = 0; j &lt; 13; j++)
          {
              //priting out the matrix 
              cout &lt;&lt; matrix[i][j];
          }
          cout &lt;&lt; "\n";
      }
      cout &lt;&lt; endl;
      return matrix[i][j];
  }
  </code></pre>
  
  <p>Here is the main function, where I attempt to assign actual parameters for the matrix and pass them to the matrix display. The main function specifically defines a variable ‘p’ which (the plan is anyway) to use this variable to cause a shift to the right. 
  I am using the modulo 13 operator to attempt to clear (or return to 0) values after the shift, so the 1 appears to move across the matrix</p>
  
  <p>In addition to the functions above, I have included the last bits from my code which are essentially notes and ideas that I am attempting now. </p>
  
  <pre><code>/*
  int array_size = sizeof(matrix) / sizeof(matrix[0]);
      for (i = 0; i &lt; 8; i++)
      {
          for (j = array_size-1; j &gt; 0; j--)
          {
              matrix[j] = matrix[j - 1];
          }
          matrix[0]=
          cout &lt;&lt; "\n";
      }
  }
  
  
  */
  
  /*
  int x = i;
      int p = (j + 3) % 13;
          int matrix(x, p);
      return 0;
  */
  </code></pre>
  
  <p>thanks in advance for any help or guidance :)</p>