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.
format when printing的更多相关文章
- Printing Architecture
Printing Architecture http://www.codeproject.com/Articles/8916/Printing-Architecture This articl ...
- 20140603 对error.c 用于分析源代码
20140603 对error.c 用于分析源代码 继续看error.c该功能 买家现在将自己的代码和数据汇编例如,下面的: 1.#include <stdio.h> 2 #inc ...
- [转]LLVM MC Project
Intro to the LLVM MC Project The LLVM Machine Code (aka MC) sub-project of LLVM was created to solve ...
- awk练习总结
>>> >>>awk是个优秀文本处理工具,可以说是一门程序设计语言.下面是awk内置变量. 一.内置变量表 属性 说明 $0 当前记录(作为单个变量) $1~$n ...
- [other] 代码量代码复杂度统计-lizard
[other] 代码量代码复杂度统计-lizard lizard的可以用来统计下面的一些数据 不包含代码注释的代码行数 CCN 代码的复杂度,也就是分支复杂度 token的个数(关键字,标示符,常量, ...
- uva 10692 高次幂取模
Huge Mod Input: standard input Output: standard output Time Limit: 1 second The operator for exponen ...
- UVA 10692 Huge Mod
Problem X Huge Mod Input: standard input Output: standard output Time Limit: 1 second The operator f ...
- N天学习一个linux命令之ssh-keygen
用途 生成ssh加密算法需要使用到的秘钥以及管理和转换 用法 ssh-keygen [-q] [-b bits] -t type [-N new_passphrase] [-C comment] [- ...
- 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 ...
随机推荐
- 在windows环境下,为什么要用Notepad++编辑?
摘自廖雪峰的git教程之创建版本库 首先这里再明确一下,所有的版本控制系统,其实只能跟踪文本文件的改动,比如TXT文件,网页,所有的程序代码等等,Git也不例外.版本控制系统可以告诉你每次的改动,比如 ...
- vim备忘
复制指定行 5,20co$(5到20行复制到最后一行之后) 指令模式下,c的使用方式与d相同,但删除后会进入INSERT模式 删除以某一符号开头或结尾的行 :%g/^\s/d(删除以空格开头的行) : ...
- thinkphp 内置标签volist 控制换行
thinkphp 内置标签volist 控制换行 volist标签通常用于查询数据集(select方法)的结果输出,通常模型的select方法返回的结果是一个二维数组,可以直接使用volist标签进行 ...
- Sublime Text 3常用快捷键
收集的一些常用快捷键: 选择类 Ctrl+D 选中光标所占的文本,继续操作则会选中下一个相同的文本. Alt+F3 选中文本按下快捷键,即可一次性选择全部的相同文本进行同时编辑.举个栗子:快速选中并更 ...
- RequestContextListener作用
spring IOC容器实例化Bean的方式有: singleton 在spring IOC容器中仅存在一个Bean实例,Bean以单实例的方式存在. prototype ...
- Hibernate5.2之HQL查询
Hibernate5.2之HQL查询 一. 介绍 Hibernate的 ...
- Navicat(连接) -1之HTTP 设置
HTTP 设置 HTTP 通道是一种连接到服务器的方法,使用与网络服务器相同的通讯协定(http://)和相同的端口(端口 80).这是当你的互联网服务供应商不允许直接连接,但允许创建 HTTP 连接 ...
- JAVA 几种引用类型学习
1.对象的强.软.弱和虚引用 在JDK 1.2以前的版本中,若一个对象不被任何变量引用,那么程序就无法再使用这个对象.也就是说,只有对象处于可触及(reachable)状态,程序才能使用它.从J ...
- 开源是一种态度、分享是一种精神 — FirApi发布、WeiXinApi更新
在云计算盛行的年代,接触开发式的平台必不可少,因项目累积的代码也不少,之前本着"重复的事情自己做一次就够了,不需要其他人在重复为此工作."的想法发布了WeiXinApi.Boots ...
- 使用chrome联调不在同一个域的请求
做前端的,用Ajax获取数据,是常有的事情,同域下自然没问题了,如果是不同域获取数据,浏览器就有个同源策略的限制. Origin * is not allowed by Access-Control- ...