Archive

Posts Tagged ‘cpp’

C/C++ Pointer-Arithmetics

February 17th, 2009 8 comments

I recently found this when looking up how C/C++ organizes memory when allocating arrays, specifically multi-dimensional arrays.

You can access the array

#define X 5
#define Y 10
int data[X][Y];

either using

data[x][y]

or

*(*(data + x) + y)

Categories: software Tags: , ,