I have the following code:
typedef struct A_{
void* values;
}A;
typedef struct C_{
int array_C[3][3];
}C;
typedef struct B_{
C c;
}B;
int main(void)
{
B* b;
A array_A[2] = {
{
&(b->c.array_C) \\ line 23
},
{
&(b->c.array_C) \\ line 27
}
};
return 0;
}
my error is in line 23 and 27 which says that &(b->c.array_C) should be const. what I am doing wrong ? adress of an array is not a const?
The reason that i am doing it is because i need to improve cyclomatic complexity of a function with 340 if statement, when each if statement is with the following form:
if( exspretion )
{
foo( address_of_array);
return false;
}
if i will change the 340 if statements to one while loop, which runs 340 times and get from the above array the argument for foo function the cyclomatic complexity will be better ?