I encountered this strange behavior in C.
This code gives me the compile warning:
expected 'double **' but argument is of type 'double (*)[2]'
What is the problem? An array of doubles is a pointer to double, right?
BTW, if I send the array itself, the assignment doesn't affect the values and I don't know why.
#include <stdio.h>
void set1(double **x)
{
(*x)[0] = (*x)[1] =1.0;
}
int main()
{
double x[2];
set1(&x);
printf("%d\n%d\n",x[0],x[1]);
}