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. Linux下部署solrCloud

    1. 准备工作 这里我只是把我的师兄教我的关于Solrcloud搭建的过程,以及需要注意的地方文档化了.感谢他教会了我很多. 1.机子IP 三台安装linux系统的机子的IP地址为: 172.24.1 ...

  2. js实现cookie记住密码

    近来做记住密码时,用js的实现方式做了一下. login.jsp页面代码 <%@ page language="java" import="java.util.*& ...

  3. python thread 多线程

    thread 模块在python3中改为_thread,网上的各种帖子都说不建议新手使用thread,好吃不好吃总得尝尝看. import _thread def print_num(): for i ...

  4. 深入解读Linux与Android的相互关系(转-lining)

    大家都知道Android是基于Linux内核的操作系统,也曾经和Linux基金会因为内核问题产生过分歧,本文将开始对Android的内核进行剖析,主要介绍Android和Linux之间的关系,后续还会 ...

  5. pods的安装和使用

    ////  pods的安装.h//  IOS笔记 /*Cocoapods安装步骤 1.升级Ruby环境 终端输入:$gem update --system 此时会出现 ERROR:  While ex ...

  6. HA(High available)--Heartbeat高可用性集群(双机热备)菜鸟入门级

    HA(High available)--Heartbeat高可用性集群(双机热备)   1.理解:两台服务器A和B ,当A提供服务,B闲置待命,当A服务宕机,会自动切换至B机器继续提供服务.当主机恢复 ...

  7. U3D外包、Unreal4外包、VR外包就找北京动点飞扬软件

    北京动点软件长年承接Unity3D(U3D外包)项目,我们制作各类型VR/AR游戏,虚拟现实,增强现实项目! 品质保证,售后完备. 联系请加QQ:372900288  电话:13911652504 我 ...

  8. PHP入门part2

    PHP的数据类型 php数据类型分为三大类, 标量类型:整型.浮点型.布尔型和字符串型 复合类型:数组型和对象(object) 特殊类型:空类型和资源型 !资源型以后会讲 整形(int)就是整数的数值 ...

  9. nodejs初探(四)实现一个多人聊天室

    我们实现的思路是,当有一个人发送过来消息,我们就广播给其他客户端. var net = require('net'); var chatServer = net.createServer(), cli ...

  10. ORA-02049: 超时: 分布式事务处理等待锁的解决方法

    是其他地方执行了操作没有提交,把其他地方提交了就好了