I'm new to C and started making a program. Here's how it looks like:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main() {
char input[10000];
printf(" >>> ");
gets(input);
printf("\n\n");
if (strlen(input) > 10000) {
printf(" Input too long (INPUT LENGTH = %d)\n", strlen(input));
return 0;
} else {
char processed_input[10000];
strcpy(processed_input, strsep(input, '$')); //The error is thrown here every time.
if (processed_input[0] == *"calculate") {
printf("helo");
return 0;
}
}
return 0;
}
It isn't completed yet, but my progress stopped when I tried to test run it and it threw this error:
warning: implicit declaration of function 'strsep' [-Wimplicit-function-declaration]
strcpy(processed_input, strsep(input, '$'));
^~~~~~
warning: passing argument 2 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion]
note: expected 'const char *' but argument is of type 'int'
_CRTIMP __cdecl __MINGW_NOTHROW char *strcpy (char *, const char *);
^~~~~~
Can someone please tell me how to fix it?
I tried ChatGPT, other questions of people in Stack Overflow and other platforms, but I still can't find out how to fix it.