#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
    const char* X = "hello again there";
    char token[1000];
    int current_pos = 0;
    int pos = 0;
    while (1 == sscanf(X + current_pos, "%999s%n", token, &pos))
    {
        current_pos += pos;
        printf("%s | %s\n", token, X + current_pos);
    }
    return 0;
}
