There is a possibility with printf, it goes like this:
printf("%.*s", stringLength, pointerToString);
No need to copy anything, no need to modify the original string or buffer.
There is a possibility with printf, it goes like this:
printf("%.*s", stringLength, pointerToString);
No need to copy anything, no need to modify the original string or buffer.