这是我写的,用的变长数组,编译时就出错。怎么办
#include <stdio.h>
#include <ctype.h>
#include <time.h>
#include <stdlib.h>
//#include <conio.h>
int output2dArr(int rows,int cols ,int arr[rows][cols]);
int main(void)
{
int num_male ,num_female;
int property_male,property_female ;
int i,j;
num_male = 150 ;
num_female = 150;
property_male = 9;
property_female = 10;
int male[num_male][property_male] ;
int female[num_female][property_female];
output2dArr(num_male,property_male,male);
return 0;
}
int output2dArr(int rows,int cols,int arr[rows][cols])
{
for (int i=0;i < rows;++i)
{
for (int j=0;j < cols;++j)
{
printf("%d ",arr[i][j]);
}
printf("\n");
}
return 0;
}