title: C++ adding two array items and other errors on run
body: <p>When I compile and run this program, I get different errors mostly regarding the calling of the function and the sum of arrays - I have tried fixing them myself but whenever I fix one problem I seem to never be able to fix them all as more come in then leave.</p>
  
  <pre><code>/*
  Even Fibonacci numbers
  Problem 2
  Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:
  
  1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
  
  By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.
  */
  
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  int increaseArray(int array, int currentPointer, int maxNumber, int arraySize, bool stop, int total);
  
  int main () {
    int arraySize = 2;
    int maxNumber = 4000000;
    int currentPointer = 1;
    int array[2] = {1, 2};
    int total = 0;
    bool stop = false;
    while (not stop) {
      increaseArray(array, currentPointer, maxNumber, arraySize, stop, total);
    }
  
  
  }
  
  int increaseArray(int array, int currentPointer, int maxNumber, int arraySize, bool stop, int total) {
    int newValue = array[currentPointer - 1] + array[currentPointer - 2];
    while (newValue &lt; maxNumber) {
      arraySize++;
      int *array = new int[arraySize];
      array[arraySize] = newValue;
      if (newValue % 2 == 0) {
         total += newValue;
  increaseArray(array, currentPointer, maxNumber, arraySize, stop, total);
  }
    stop = true;
    return total;
    }
  
   };
  </code></pre>
  
  <p>Here are the errors that I am getting:-</p>
  
  <p>error: no matching function for call to 'increaseArray'
  increaseArray(array, currentPointer, maxNumber, arraySize, stop, total);
  ^~~</p>
  
  <p>note: candidate function not viable: no known conversion from 'int [2]' to 'int' for 1st argument
  int increaseArray(int array, int currentPointer, int maxNumber, int arraySize, bool stop, int total);
  ^
  error: subscripted value is not an array, pointer, or vector
  int newValue = array[currentPointer - 1] + array[currentPointer - 2];
  ~^~~~~</p>
  
  <p>error: subscripted value is not an array, pointer, or vector
  int newValue = array[currentPointer - 1] + array[currentPointer - 2];
  ~^~~~~</p>
  
  <p>error: no matching function for call to 'increaseArray'
  increaseArray(array, currentPointer, maxNumber, arraySize, stop, total);
  ^~~</p>
  
  <p>note: candidate function not viable: no known conversion from 'int ' to 'int' for 1st argument; dereference the argument with 
  int increaseArray(int array, int currentPointer, int maxNumber, int arraySize, bool stop, int total) {
  ^
  4 errors generated.</p>