working on a hacker-rank problem, the Printing tokens in C. My question does not come from the logic of the problem. i.e. finding the space and instead printing a '\n' rather it comes from the bit of code that is given.
char *s;
s = malloc(1024 * sizeof(char));
scanf("%[^\n]", s);
s = realloc(s, strlen(s) + 1);
Im compiling on a Mac terminal window and am getting an incompatible type from char * to void * Ive tried a few things including type casting, but that seems to get me deeper into trouble. Can someone explain what else my issue is? Thanks