I have a string, let\'s say \"THESTRINGHASNOSPACES\".
I need something that gets a substring of 4 characters from the string. In the first call, I should get \"THES\
If you just want to print the substrings ...
char s[] = "THESTRINGHASNOSPACES"; size_t i, slen = strlen(s); for (i = 0; i < slen; i += 4) { printf("%.4s\n", s + i); }