Don is right that fwrite is the quickest.
That said, here's a little know feature of printf (and snprintf, vprintf, etc.) that allows you to do it in one call.
printf("%.*s", to - from, aString + from);
How this works. Providing a precision for a string says print no more then that many characters (it can print less if it finds a '\0' first). So a line like:
printf("%.5s", "0123456789");
will print:
01234
Next, if you need to specify your precision at runtime, replacing the number with a * and provide the length as a function parameter before the string:
printf("%.*s", 5, "0123456789"); // same as before
If all you want to do is print the one part of the string this trick is overkill. But in combination with other formatting, it can be quite helpful:
printf("Token %d: \"%.*s\"\n",
tok,
token_info[tok].len,
str + token_info[tok].start);