× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



% is start of conversion specification
- is left justify the converted argument
10 is the minimum field width to be printed from the converted argument
. is a separator between minimum field width and precision
10 is the precision or maximum number of characters to be printed from the
converted argument
s indicates the type of argument to be converted is a null terminated
character string and also signals the end of the conversion specification

Bruce Vining




"Lim Hock-Chai" <Lim.Hock-Chai@xxxxxxxxxxxxxxx>
Sent by: c400-l-bounces+bvining=us.ibm.com@xxxxxxxxxxxx
07/24/2007 08:42 AM
Please respond to
C programming iSeries / AS400 <c400-l@xxxxxxxxxxxx>


To
<C400-L@xxxxxxxxxxxx>
cc

Subject
[C400-L] sprintf's char *format parameter






char password[NAME_SIZE];
char sy_password[NAME_SIZE]

sprintf(sy_password, "%-10.10s", password);


I'm not very familiar with C. Can somebody tell me what does %-10.10s
format means? Looking up some info on the web, it seems like the - sign
means left justify. s means convert to string pointer. I'm not
understanding 10.10.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.