void initial_temp(double temp[][SIZE])
{
for (int i = 1; i<SIZE; i++)
{
const double ELEMENT = 100;
temp[0][i]=ELEMENT;
temp[SIZE][i]=ELEMENT;
for (int row = 1; row<SIZE; row++)
{
temp[i][row]=0;
}
}
for (int i =0; 1<=SIZE; i++)
{
temp[i][0]=0;
temp[i][SIZE]=0;
}
return;
}
int main()
{
double temp[SIZE][SIZE];
initial_temp (temp);
return 0;
}
The error message gives the option to break, and shows the breakpoint at the line where i try to call initial_temp() in main().
The assignment is due tomorrow and I have a long way to go, any help would be much appreciated.
All these errors result in data outside the boundaries of the array being accessed.
The subscript needs to go from 0 to 19.
If you try to update memory which you do not own, an access violation is the result.
The 1<SIZE error was the biggest, as both 1 and SIZE are constant, thus the loop never terminates and the program would go on writing to memory throughout the whole machine, if it was allowed.
I think "0xC0000005" is a standard Microsoft error code, Google returns lots of hits for it.