Consider the following, you have two sets of arrays - one of which has some set of integers stored with values, you can put these in an array and cout the value in the array with ease. However when you have an array with empty integers within it - it does not seem to be able to "store" the values to the integer value - why?
Here is an example:
int empty1;
int empty2;
int contain1 = 100;
int contain2 = 200;
int container [2] = { contain1, contain2 };
int empty_container [2] = { empty1, empty2 };
int i = 0;
while ( i != 2 ) {
empty_container[i] = i;
cout << endl << "empty_container[i]: " << empty_container[i] << endl
<< "empty1: " << empty1 << endl << "empty2: " << empty2 << endl;
cout << "i: " << i << endl;
cout << "container[i]: " << container[i] << endl;
cout << "contain1: " << contain1 << endl;
cout << "contain2: " << contain2 << endl;
i++;
}
Output:
empty_container[i]: 0
empty1: 4197341
empty2: 0
i: 0
container[i]: 100
contain1: 100
contain2: 200
empty_container[i]: 1
empty1: 4197341
empty2: 0
i: 1
container[i]: 200
contain1: 100
contain2: 200
Notice how empty1 all of a sudden has the value "4197341" while empty2 is 0, what is going on here?
UPD(from comments):