質問

I am bit struggling with kinda easy task. I need to convert array to pointer.

GLfloat serieLine[8][80];

GLfloat *points = &serieLine[0][0];

this gives me just first value, but how can I get all values in the array?

役に立ちましたか?

解決

If you want pointer to an array, you can do it like this:

GLfloat (*points)[80] = serieLine;

points will point to the first row of serieLine. If you increment points, it will point to the next row.

他のヒント

Increment the pointer, and it'll point at the next value in the array (so once you've incremented it 8*80 times you'll have seen all of the values)

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top