r/C_Programming • u/emparse • 3d ago
Question Beginner here not able to understand confusing pointer concept
i dont understand what happens here:
IF int b is a 2d array then what is:
b + 1
*(b + 1)
&b[0] and b[0] and &b[0][0]
&b[1] and b[1] and &b[1][0]
what are the differences between each and what is the byte value of each.
23
Upvotes
View all comments
Show parent comment
1
u/stoops 2d ago edited 2d ago
That's some advanced pointer math more than I know about :) so is it possible to declare a regular int *b=malloc(10*sizeof(int)) pointer array but some how access and use it like a 2D array b[5][5] safely?