I am trying to tokenize a sentence that starts with spaces but I get segmentation fault. I am trying to skip the spaces and store the words. Is there an alternative built-in function to achieve this?
#include <string.h>
#include <stdio.h>
[...]
char *buff = " push me", *token;
token = strtok(buff, " \n");
while (token) {
printf("%s", token);
token = strtok(NULL, " \n");
}
[...]