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.

format when printing的更多相关文章

  1. Printing Architecture

    Printing Architecture http://www.codeproject.com/Articles/8916/Printing-Architecture     This articl ...

  2. 20140603 对error.c 用于分析源代码

    20140603 对error.c 用于分析源代码 继续看error.c该功能 买家现在将自己的代码和数据汇编例如,下面的:   1.#include <stdio.h>   2 #inc ...

  3. [转]LLVM MC Project

    Intro to the LLVM MC Project The LLVM Machine Code (aka MC) sub-project of LLVM was created to solve ...

  4. awk练习总结

    >>> >>>awk是个优秀文本处理工具,可以说是一门程序设计语言.下面是awk内置变量. 一.内置变量表 属性 说明 $0 当前记录(作为单个变量) $1~$n ...

  5. [other] 代码量代码复杂度统计-lizard

    [other] 代码量代码复杂度统计-lizard lizard的可以用来统计下面的一些数据 不包含代码注释的代码行数 CCN 代码的复杂度,也就是分支复杂度 token的个数(关键字,标示符,常量, ...

  6. uva 10692 高次幂取模

    Huge Mod Input: standard input Output: standard output Time Limit: 1 second The operator for exponen ...

  7. UVA 10692 Huge Mod

    Problem X Huge Mod Input: standard input Output: standard output Time Limit: 1 second The operator f ...

  8. N天学习一个linux命令之ssh-keygen

    用途 生成ssh加密算法需要使用到的秘钥以及管理和转换 用法 ssh-keygen [-q] [-b bits] -t type [-N new_passphrase] [-C comment] [- ...

  9. The Basics of 3D Printing in 2015 - from someone with 16 WHOLE HOURS' experience

    全文转载自 Scott Hanselman的博文. I bought a 3D printer on Friday, specifically a Printrbot Simple Metal fro ...

随机推荐

  1. LVM逻辑卷管理

    一.LVM简介 LVM(Logic Volume Manager)逻辑卷管理,简单理解就是将一块或多块硬盘的分区在逻辑上集合,当一块大硬盘来使用. 其特点是: 1.可以实现在线动态扩展,也可以缩减 2 ...

  2. 使用as3控制动画

    1.建立按钮元件 2.在属性面板使用英文为按钮元件命名,例如playButton 3.建立函数,例如 function startMovie(event:MouseEvent):void {  thi ...

  3. ASP.NET应用程序与页面生命周期

    http://www.cnblogs.com/suizhouqiwei/archive/2012/08/15/2637775.html

  4. TTS多音字问题

    今天在CSDN上找到了解决方案,终于解决了多音字问题.   Text1.Text = "<pron sym='jia 3'> 贾</pron>宝玉,商<pron ...

  5. 化繁为简 如何向老婆解释MapReduce?(转载)

    化繁为简 如何向老婆解释MapReduce? 昨天,我在Xebia印度办公室发表了一个关于MapReduce的演说.演说进行得很顺利,听众们都能够理解MapReduce的概念(根据他们的反馈).我成功 ...

  6. 将STM32的标准库编译成lib使用【图文】

    以前一直使用STM32的标准库,需要一步步地将代码加进去,将编译选项设置好,然后再编译整个工程. 这个编译过程是一个相当慢的过程!完全编译大约需要一支烟的时间.每次建立工程都这么编译,是一个相当浪费时 ...

  7. 一个可以设置所有子控件是否可以点击的Layout的实现

    http://www.cnblogs.com/csonezp/p/4956315.html 最近在做一个功能,想在某个状态设置整个界面不可点击,后台任务执行完毕后再可以点击. 最直观的想法是直接让所有 ...

  8. 加快phpstorm、rubymine、pycharm系列IDE运行速度的方法

    对jetbrains公司出品的IDE均有效,以rubymine为例: 打开C:\Program Files\JetBrains\RubyMine 6.3.3\bin,打开 rubymine.exe.v ...

  9. 配置SQL Server 2005 远程连接(转)

    方法如下:  一.为 SQL Server 2005 启用远程连接1. 单击"开始",依次选择"程序"."Microsoft SQL Server 2 ...

  10. js--使用构造器函数来新建对象及操作

    通过new操作符来调用函数,来达到访问对象this值得目的,构造器将其创建的对象返回给我们. 直接上代码 //创建构造器函数 function Gadget(name, color){ this.na ...