#include <cstdlib>
#include <iostream>
int sum (int a[][100],int s);
usingnamespace std;
int main()
{
int N;
int n=N-1;
int s=0;
cout<< " Please insert size of your sequare matrix= ";
cin>>N;
int a[N][100];
cout<< " Please insert values of your sequare matrix= ";
for (int i=0; i<N; i++)
for (int j=0; j<N; j++)
cin>>a[i][j];
for (int i=0; i<N; i++)
{ for (int j=0; j<N; j++)
cout<<a[i][j]<<" ";
cout<<endl;
}
cout<<"sum of outer cells="<< sum (a, s);
int sum (int a[][100],int s);
for (int i=0; i<N; i++);
for (int j=0; j<N; j++);
{
int i;
int j;
if(i==0||i==n);
s=s+a[i][j];
if(j==0||j==n);
s=s+a[i][j];
return s;
}
system("PAUSE");
return EXIT_SUCCESS;
}
.
First of all you should re-study how to write and call a function... You put your "sum" function definition inside the main and with no curly brackets: there is no way this code can work!