Excuse me if the title is misleading.
I'm attaching below some parts of my code which I think would be relevant to understanding the errors that the compiler flagged.
#include <stdio.h>
size_t count_gen(const size_t rowbound,const size_t colbound,const int num,double input[][rowbound][colbound],double output[][colbound])
{
size_t i,j,row;
for(j = 0; j < colbound; ++j)
{
for(i = 0; i < rowbound; ++i)
{
for(row = 0; row < rowbound; ++row)
{
if(row == i)
continue;
else if(input[num][i][j] >= input[num][row][j])
output[i][j]+=1;
}
}
}
}
...
int main(void)
{
size_t i,j,k,m,n;
printf("Enter the number of parameters: ");
scanf("%zu",&m);
printf("Enter the number of objects: ");
scanf("%zu",&n);
double SVNSFSS[4][n][m];
size_t counts1[n][m] = {{0}};
...
count_gen(n,m,0,SVNSFSS,counts1); // 1st call to the function "count_gen"
...
return 0;
}
The errors:
5 99 C:\Users\dell pc\OneDrive\Documents\C programs\SVNSFSS_project.cpp [Error] use of parameter outside function body before ']' token
5 109 C:\Users\dell pc\OneDrive\Documents\C programs\SVNSFSS_project.cpp [Error] use of parameter outside function body before ']' token
5 110 C:\Users\dell pc\OneDrive\Documents\C programs\SVNSFSS_project.cpp [Error] expected ')' before ',' token
5 111 C:\Users\dell pc\OneDrive\Documents\C programs\SVNSFSS_project.cpp [Error] expected unqualified-id before 'double'
So, I got the errors in line 3 (in accordance with the code above), and it marked the second dimension namely rowbound
of the function argument double input[][rowbound][colbound]
as erroneous.
I am sort of clueless on how to resolve the issue! Please suggest what I should do.