We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Has anyone found a way to pass 2 dimentional arrays to a function? My arrays are stored in code and I need to pass them to a function to display them. Gary Martin
Yes, Without testing, it works. But when tested it doesn't.
void func(int ** pArray2d)
unsigned char _2d_array [5][5]; void func (unsigned char (*x)[5]) { x [0][0] = 1; x [1][0] = 6; x [2][1] = 12; } void main (void) { func (_2d_array); while (1); }
void func (unsigned char (*x)[5])
Whoops, you are quite right.