I am formatting an output record with printf. The argument type is %15s, but it is possible that the input may be longer than 15. Is there anyway to code the %s argument to truncate the field, or do I need extra code to assure the field is a max of 15?
yes.. you can specify the length of the string in your printf for formatting records.. you need to include a '.'followed by the num of chars in the string you want to print.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.