title: copying elements from one array to another
body: <p>I am getting a crash error at run time and not sure what exactly to do with the function or how to get the data for it.</p>
  
  <h3>FUNCTION DETAILS</h3>
  
  <p>Write a function that accepts an <code>int</code> array and <code>size</code> as arguments, then create a new array that is one element bigger than the given. Setting the first element to <code>0</code>, then copying over what is in the argument array to the new array.</p>
  
  <h3>MAIN DETAILS</h3>
  
  <p>Use in a program reading <code>int n</code> from input, then read <code>int n</code> from file data name <code>data</code>
  passing it to element shifter, then printing it to output (one per line).</p>
  
  <pre><code>#include &lt;cstdlib&gt;
  #include &lt;iostream&gt;
  #include &lt;fstream&gt;
  using namespace std;
  
  int element_shift(int elmts[], int size) {
    int new_size = size + 1;
    int shifter[new_size];
    int *elmt_sft;
    shifter[0] = 0;
    for (int i = 1; i &gt;= new_size; i++) {
      shifter[i + 1] = elmts[i];
    }
    return *elmt_sft;
  }
  
  int main() {
    fstream infile;
    infile.open("D:\\data.txt");
    int n, x;
    infile &gt;&gt; x;
    cout &lt;&lt; "size of array: ";
    cin &gt;&gt; n;
    const int ARRAY_SIZE = n + x;
    int elements[ARRAY_SIZE];
    element_shift(elements, ARRAY_SIZE);
  
    system("PAUSE");
    return EXIT_SUCCESS;
  }
  </code></pre>