pointers problems

/*************************************************************************/
/* Dear all i am having troubles storing or printing out the value stored*/
/* at the address to which my variable W points at. the variable is a */
/* pointer to a pointer = double **W , if anyone could help as i get this */
/* error message: error: cannot convert ‘double*’ to ‘double’ in */ /* assignment */
/*************************************************************************/



for (int i=0;i < 6; i++)
{
for (int j=0;j<6;j++)
{
// B[j + 6*i] = W[i][j];
B[j + 6*i] = W[j + 6*i];
}
}
It looks like the handling changed from 2d to 1d. Hence the type for W is supposed to be

double *W; // Note only 1 *
you are reading like if it was a 1d array, but is 2d . it is different , the segmentation. Simply put 1 star
Topic archived. No new replies allowed.