Code: Select all
for(int i = 0; i < MAX; i++)
{
unsigned zeroflag = 0;
if (zeroflag == 0)
{
L[i] = l[i];
R[i] = r[i];
if (i >= size)
{
zeroflag = 1;
}
}
else
I had expected the zero flag to be initialized only once, or something like that? If I move the assigment outside the for loop, it works. Does this mean in XC I cannot perform variable initialization inside a for loop? That seems like an issue I would really need to know: You can't declare variables with a scope of the for loop? Maybe this is standard C stuff?? Did a little googling and didn't find anything.