Original Post
Hello again and no this isnt about those **** and blanks. I have posted the code below and this is actually right out of the book, when i compile and run using Visual Studio 2005, i get a msg saying "Stack around the variable "sum" was corrupted.
#include <iostream>
using namespace std;
int main(){
int array0[7] = {1,2,3,4,5,6,7};
int array1[7] = {-9,-8,-7,-6,-5,-4,-3};
int sum[7];
for (int i=0; i < 7; ++i){
sum[7]= array0 + array1;
cout << array0 << " + " << array1 << " = ";
cout << sum << endl;
}
}
The output is incorrect as well: 1 + -9 = -858993460 2 + -8 = -858993460 and so on, they all equal that large negative number. What did i do wrong or how can i fix this.