try it, then you know it____________just do it , as love easily fade.

一次只有一个目标,步子迈小些,抑制一次实现所有功能的冲动。 过程如何结果就如何,行动是欢喜的,不管是兴奋还是沮丧的情绪都对结果无益。贵在持之以恒

导航

format when printing

http://msdn.microsoft.com/en-us/library/vstudio/56e442dc.aspx

%[flags] [width] [.precision] [{h | l | ll | w | I | I32 | I64}] type

width

Optional decimal number that specifies the minimum number of characters that are output. 

If the number of characters in the output value is less than the specified width,

blanks are added to the left or the right of the values—depending on whether the left alignment flag (-) is specified—until the minimum width is reached.

precision

Optional decimal number that specifies the maximum number of characters that are printed for strings, the number of significant digits or the number of digits after the decimal-point character for floating-point values, or the minimum number of digits that are printed for integer values. 

float:  printf( "%.*f", 3, 3.14159265 ); /* 3.142 output */

string: The precision specifies the maximum number of characters to be printed. Characters in excess of precision are not printed.

 

 

 

posted on 2013-12-09 13:58  吾一  阅读(180)  评论(0编辑  收藏  举报