I am having trouble with following struct for using it as Matrix
struct{
int col;
int row;
int (*p)[col];//In this line compiler is giving error, saying col undeclared here.
}Matrix;
I searched on internet and I found a solution which says to write
int (*p)[col]
as
int (*p)[]
Compiler passes it, no issues.
But when I want to increment p using Matrix variable say m
++(m.p);
compiler gives another errors (two) in the same line of code, which says
increment of pointer to unknown structure.
arithmetic on pointer to an incomplete type.
Please tell me why the compiler is giving the above mentioned errors?
What I finally want is to have a pointer in the structure which points to 2-d dynamic array of integers. So,How to do it???