When my professor taught about double-pointers and two-dimensional arrays, he wrote like this in his lesson:
char* words[]={"one","two","three"};
Later he introduced another kind of writing style:
int (*table)[3];
But after class, when I try writing on my own, I wrote:
char (*word)[6]={"one","two","three"};
Then it came error: the error
Furthermore, if I wrote like:
char table[][6]={"one","two","three"};
char (*word)[6]=table;
It ran successfully, which meant it just couldn't be initialized(?)
Could you please tell me the difference between
char* words[]={"one","two","three"};
and
char (*word)[6]={"one","two","three"};
and tell me why the latter one encountered with error?
I googled and searched the error info in the website, but found nothing useful. Neither can my classmates answer my questions, I have asked my prof but he hasn't answered me yet.
I have found the difference between the two styles, the only question now is the cause of the error!