char** strsep(const char* str)
{
char** returnStrings = NULL;
for (int i = 0; i < strlen(str); i++)
{
if (str[i] == ' ') returnStrings[sizeof(returnStrings)/sizeof(returnStrings[0])] = "";
else returnStrings[sizeof(returnStrings)/sizeof(returnStrings[0])] += str[i];
}
return returnStrings;
}
I'm trying to make a function that can split a sentance(string) into an array of words(also strings), but it will not compile and says error: implicitly declaring library function 'strlen' with type 'unsigned long (const char *)' [-Werror,-Wimplicit-function-declaration]
. It says that I am entering an unsigned long as a parameter to strlen(), but I am not. i have #include <stdio.h>
in my code.