I have this function to tokenize an input string:
int tokenize(char input, char* tokens, char delimiter)
There are invocations of the function with different size of array. For instance,
char tokens; tokenize(input, tokens, " "); char tokens1; tokenize(tokens, tokens1, ":");
as you can see the token holder array passed to tokenize can be of different dimension so I am trying to define the tokenize function so that second argument has a array dimension unspecified. But whatever I do it does not work:
int tokenize(char input, char** tokens, char delimiter); int tokenize(char input, char* tokens, char delimiter); int tokenize(char input, char (*tokens), char delimiter); of which I find the last one the most amusing: 10281.c:79: error: cannot convert ‘char (*)’ to ‘char (*)’ for argument ‘2’ to ‘int tokenize(char*, char (*), const char*)’
I thought the first one should work as the 2dimensional array should be considered as pointer to pointer.
I don't know what can I do *court* my compiler to do his job.