V
Vol
Hi, Group,
I want to initialize a 2D static array in function 'foo ()', where
'foo' is called by another function a lot of times.
I list my implementation below but I think there are better
solutions , thanks
void foo()
{
int i, j;
static int dis_sum[100][100] = {18*90};
static int tmp = 0;
if (tmp == 0)
{
for(i = 0; i < 100; i++)
for(j = 1; j < 100; j++)
dis_sum[j] = 18*90;
}
tmp = 1;
}
I want to initialize a 2D static array in function 'foo ()', where
'foo' is called by another function a lot of times.
I list my implementation below but I think there are better
solutions , thanks
void foo()
{
int i, j;
static int dis_sum[100][100] = {18*90};
static int tmp = 0;
if (tmp == 0)
{
for(i = 0; i < 100; i++)
for(j = 1; j < 100; j++)
dis_sum[j] = 18*90;
}
tmp = 1;
}