int main()
{
const int OuterTemp=20;
const int InnerTemp=20;//this is for the Outside
int f;//row
int j;//column
int T;//Tempeture
int temp1;
int temp2;
for(f=0;f<OuterTemp;f++)
{
cout<<"Please enter in the tempeture.." <<endl;
cin>>temp1;
for(j=0;j<InnerTemp;j++)
{
cout<<"please enter in the tempeture.."<<endl;
cin>>temp2;
}
}
T[f][j]=1/4 (T [f-1] [j]+ T [f] [j-1] + T [f] [j+1] );
cout<<T;
system("pause");
return 0;
}
C:\Users\Glenda hayes\Documents\c++ programing labs\lab7.cpp: In function `int main()':
C:\Users\Glenda hayes\Documents\c++ programing labs\lab7.cpp:32: error: invalid types `int[int]' for array subscript
C:\Users\Glenda hayes\Documents\c++ programing labs\lab7.cpp:32: error: invalid types `int[int]' for array subscript
C:\Users\Glenda hayes\Documents\c++ programing labs\lab7.cpp:32: error: invalid types `int[int]' for array subscript
C:\Users\Glenda hayes\Documents\c++ programing labs\lab7.cpp:32: error: invalid types `int[int]' for array subscript
C:\Users\Glenda hayes\Documents\c++ programing labs\lab7.cpp `4' cannot be used as a function
In C++ multiplication is not implicit like in math. I don't know if it is multiplication you want.
Also note that 1/4 will do integer division and give the value 0. If you meant 0.25 you better write it as "0.25". If you want to use division just make sure at least one of the operands are of floating point type if you want the result to be a floating point type.