c++ - Understand the following pointer code written in c -
i trying understand piece of code , not experienced programmer. can please me understand meant statement here?
dimage *filterdimage; float *lp = filterdimage->pixels[0];//statement a, what's going on?
here, dimage struct defined :
typedef struct dimage{ int width; int height; float **pixels; }
filterdimage->pixels
accesses pixels
member in filterdimage
.
filterdimage->pixels[0]
accesses first element in array pixels
points to. since pixels
of type float**
, elements of type float*
.
float *lp = filterdimage->pixels[0]
assigns pointer lp
.
Comments
Post a Comment