#include <stdio.h>

int main(void) {
	char *input = "100 200 300 400 -6";
	int array[100];
	int total = 0;
    int cont = 0;
    int ret = 1;
    while(ret == 1 && total < 100) {
        ret = sscanf(input, "%d%n", &array[total++], &cont);
        input += cont;
    }
    total--;
    printf("Total read = %d\n", total);
	for(cont = 0; cont < total; cont++)
		printf("%d, ", array[cont]);
	return 0;
}
