I'm trying to pass an array of strings to another function and have it modified there. Here is where I declare the array and the declaration of the other function. (Effectively what I am doing is taking a string of chars, and sorting them into words into the array of strings, throwing out the whitespace). The sizes of the array are simply due to instructions for what I am working on. "strInput" is a the large array of chars I will be "cleaning"
char cleaned[151][21];
cleanInput(strInput, &cleaned);
Then later I declare:
void cleanInput(char* s, char* cleaned[151][21])
{
//do stuff
}
This is giving me a warning.
warning: passing argument 2 of ‘cleanInput’ from incompatible pointer
type [-Wincompatible-pointer-types]
cleanInput(strInput, &cleaned);
note: expected ‘char * (*)[21]’ but argument is of type ‘char (*)[151][21]’
void cleanInput(char* s, char* cleaned[151][21]);
I've tried a few different ways of passing it, but from what I see im passing a pointer to a two-dimensional array, and its asking for a pointer to a two-dimensional array. I am unsure why its invalid.