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

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -