I wrote this little function in c:
void initializeArray(char arr[ROWS][COLS]){
int i,j;
for (i=0; i<COLS; i++){
for (j=0; j<ROWS; j++){
arr[i][j] = ' ';
}
}
}
Edit: ROWS and COLS are defined in a header file
When I call it i keep getting a segmentation fault. If I traverse the array using a pointer its okay, any ideas why?
p.s. The array being passed was defined outside a function so there's no link problems.
COLSdimension on the parameter declaration doesn't mean anything; the parameter is really a pointer, not an array.