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

int main(void) {
	const char my_string[] = "[1,2,3,4,5]";
    const char *curr = &my_string[1];
    while (curr != NULL) {
    	int tmp;
    	sscanf(curr, "%d", &tmp);
    	printf("%d\n", tmp);
    	
    	/* find next comma */
    	curr = strchr(curr, ',');
    	
    	/* if a comma was found, go to next integer */
    	if (curr)
    		curr += 1;
    }
	return 0;
}
