This is my code in atmel 6 using c :
#include
#include
#include
int a[][][] initialize_hueristic(int[]);
int main(void)
{
int goal[3],grid_size[3];
int i, j, k;
int hueristic[grid_size[0]][grid_size[1]][grid_size[2]];
hueristic = initialize_hueristic(grid_size);
hueristic[0][1][0] = 10;
PORTA = hueristic[0][1][0];
}
int a[][][] initialize_hueristic(int grid_size[])
{
int hueristic[grid_size[0]][grid_size[1]][grid_size[2]];
int i, j, k;
for(i = 0; i < grid_size[0] ; i++)
{
for(j = 0; j < grid_size[1]; j++)
{
for(k = 0; grid_size[2]; k++)
{
hueristic[i][j][k] = 0;
}
}
}
return hueristic;
}
The atmel studio tells me the following errors :
1.`incompatible types when assigning to type 'int[(unsigned int)(grid_size[0])][(unsigned int)(grid_size[1])][(unsigned int)(grid_size[2])]' from type 'int'`
2.`expected '=', ',', ';', 'asm' or '__attribute__' before 'initialize_hueristic'`
3.`expected '=', ',', ';', 'asm' or '__attribute__' before 'initialize_hueristic'`
Could someone please tell me the error in my code ??
What is int a[][][]?