So I'm trying to make a program that will separate one array of ints into two, one for even ints, and one for uneven ints. Now, the strange thing is, if I only enter even or uneven numbers into the base array, the program works fine, but if I enter a mix of the two, one of the values held by the two new array will be a random, usually negative, big number, any idea why that is?

```
#include <iostream>
using namespace std;

void main()
{
    int *a, n, *even_nums = 0, *uneven_nums = 0, counter_even = 0,counter_uneven = 0;
    cout << "How many values does your array have?\n" << endl;
    cin >> n;
    a = new int[n];
    cout << "\nEnter the values in your array:" << endl;
    for (int i = 0; i < n; i++)
    {
        cout << "a[" << i << "] = ";
        cin >> a[i];
        if (a[i] % 2 == 0)
            counter_even++;
        else 
            counter_uneven++;
    }
    if (counter_even == 0)
        cout << "There are no even numbers in your array." << endl;
    else
        even_nums = new int[counter_even];
    if (counter_uneven == 0)
        cout << "There are no uneven numbers in your array." << endl;
    else
        uneven_nums = new int[counter_uneven];
    for (int i = 0; i < n; i++)
    {
        if (a[i] % 2 == 0)
            even_nums[i] = a[i];
        else
            uneven_nums[i] = a[i];
    }
    if (counter_even != 0)
    {
        cout << "\nThe even numbers in your array are:" << endl;
        for (int i = 0; i < counter_even; i++)
            cout << even_nums[i] << " ";
    }
    if (counter_uneven != 0)
    {
        cout << "\nThe uneven numbers in your array are:" << endl;
        for (int i = 0; i < counter_uneven; i++)
            cout << uneven_nums[i] << " ";
    }
    system("PAUSE");
}

```