How do you pass two dimensional arrays into a function?
When I pass it, it shows up in the visual studio debugger as a single dimensional array.
The problem was that when I index sel_col[i], it gets the next character, instead of the next word.
Here is my function prototype:
void print_row(char sel_col[MAX_IDENT_LEN][MAX_IDENT_LEN]);
And here is the definition of my 2d array, and where I call it:
char sel_col[MAX_NUM_COL][MAX_IDENT_LEN];
print_row(sel_col);
Solution 1: Remove the first size identifier. Didn't work.
void print_row(char sel_col[][MAX_IDENT_LEN]);
Solution 2: Pass it by reference into the function. Didn't work.
print_row(&sel_col);
Solution 3: Use double pointers. I don't want to go this route, since I would rewrite most of my code.