M
mdh
Could someone help clear up some confusion for me.
I am trying to understand how pointers and multidimensional arrays
inter-relate.
Given:
static char daytab[2][13] = {
{0,31,28,31,30,31,30,31,31,30,31,30,31},
{0,31,29,31,30,31,30,31,31,30,31,30,31}
};
and char *p;
if p is set to point to the first row, ( p=daytab[0]) then my
understanding is that p++ will point to daytab[0][1] etc. What I am
uncertain about is what happens once p reaches the end of the row?
Does it then pick up the second row and do the same( ie point at each
column in row 2)?
And lets say that one wishes to point to the "ith" row in a 20
dimensional array. How does one do this.
I am sure the answers will spark more questions, but thank you in
advance.
I am trying to understand how pointers and multidimensional arrays
inter-relate.
Given:
static char daytab[2][13] = {
{0,31,28,31,30,31,30,31,31,30,31,30,31},
{0,31,29,31,30,31,30,31,31,30,31,30,31}
};
and char *p;
if p is set to point to the first row, ( p=daytab[0]) then my
understanding is that p++ will point to daytab[0][1] etc. What I am
uncertain about is what happens once p reaches the end of the row?
Does it then pick up the second row and do the same( ie point at each
column in row 2)?
And lets say that one wishes to point to the "ith" row in a 20
dimensional array. How does one do this.
I am sure the answers will spark more questions, but thank you in
advance.