I am trying to pass the address of strings_line_tokens to split_string. I would think I would need the "&" for the address then one of these methods would work.
static void split_string(const char *buffer, size_t buflen, char ***strings_line_tokens)
static void split_string(const char *buffer, size_t buflen, char **strings_line_tokens)
static void split_string(const char *buffer, size_t buflen, char **strings_line_tokens[])
static void split_string(const char *buffer, size_t buflen, char ***strings_line_tokens[])
Here is my declaration and where I try to pass the address to the function.
char *strings_line_tokens[503] = {0};
split_string(line, strlen(line)+1, &strings_line_tokens);
I keep getting some variation of this error.
warning: passing argument 3 of ‘split_string’ from incompatible pointer type main.c:73: note: expected ‘char ***’ but argument is of type ‘char * (*)[503]’
My goal after I properly pass the variable to my function is to do this. And after that I want to be able to use those values in main.
strings_line_tokens[*big_boy_counter] = malloc(strlen(ptr[i])+1);
strcpy(strings_line_tokens[*big_boy_counter], ptr[i]);