431,757 Members | 1,990 Online
Need help? Post your question and get tips & solutions from a community of 431,757 IT Pros & Developers. It's quick & easy.

# how does one write: sizeof(array of 5 "pointers to double")

 P: n/a Hi! Q. 1) How does one write: sizeof(array of 5 "pointers to double") ??? I know that sizeof(pointer to an array of 5 doubles) can be written as: sizeof(double (*)[5]); Q. 2) Why does this work: int main(void) { double array_of_5_double[] = {0.5, 1.5, 2.5, 3.5, 4.5}; double *X[5] = \ {&array_of_5_double[0], /* array_of_5_double */ \ &array_of_5_double[1], \ &array_of_5_double[2], \ &array_of_5_double[3], \ &array_of_5_double[4]}; return 0; } but this NOT WORK int main(void) { double array_of_5_double[] = {0.5, 1.5, 2.5, 3.5, 4.5}; double *X[5]; X = \ {&array_of_5_double[0], /* array_of_5_double */ \ &array_of_5_double[1], \ &array_of_5_double[2], \ &array_of_5_double[3], \ &array_of_5_double[4]}; return 0; } ???? How can the bottom code snippet be written? Thanks. -anon.asdf Aug 12 '07 #1