#include <stdio.h>

int main(void) {
	#define BUFFSIZE 100
	char buf[100]   = { '\0' };
	char resbufI[6]    = { '\0' };
	char resbufII[11]  = { '\0' };
	char resbufIII[11] = { '\0' };
	char str[] = "01234 0123456789 01234";
	
	sprintf(buf, "%%5s %%%ds %%%ds", BUFFSIZE / 10, BUFFSIZE / 10);

    printf("buf: \"%s\"", buf);
    
    /* Use buf = "%5s %10s %10s" */
    sscanf (str, buf, resbufI, resbufII, resbufIII);
    
    printf("\nresbufI:   \"%s\""
           "\nresbufII:  \"%s\""
           "\nresbufIII: \"%s\"",
           resbufI,
           resbufII,
           resbufIII);
    
	return 0;
}
