Continue reading "printf a Limited Number of Characters from a String"
printf a Limited Number of Characters from a String
I learned recently that you can control the number of characters that printf will show for a string using a precision specifier (assuming your printf implementation supports this). There are two ways to approach string-limiting. The first method specifies the number of characters to print inside the format string itself: // Only 5 characters printed …
