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 ...
随机推荐
- js 设置Cookie 在PHP中读取(大师手法)
设置Cookie时要把一个json整体放入Cookie而不是单独放入,影响效率. var Cookies = {}; /** * 设置Cookies */ va ...
- MQTT协议的简单介绍和服务器的安装
最近公司做的项目中有用到消息推送,经过多方面的筛选之后确定了使用MQTT协议,相对于XMPP,MQTT更加轻量级,并且占用用户很少的带宽. MQTT是IBM推出的一种针对移动终端设备的基于TCP/IP ...
- Discovering the Computer Science Behind Postgres Indexes
This is the last in a series of Postgres posts that Pat Shaughnessy wrote based on his presentation ...
- centos-系统语言检查设置安装
查看当前系统语言 登陆linux系统打开操作终端之后,输入 echo $LANG可以查看当前使用的系统语言. 查看安装的语言包 查看是否有中文语言包可以在终端输入 locale命令,如有zh cn 表 ...
- Bootstap datetimepicker报错TypeError: intermediate value(转)
原文转自:http://blog.chinaunix.net/uid-20332519-id-5733546.html Bootstrap datetimepicker有多个版本,官方的链接中,只是d ...
- c#操作文件夹得读写权限
对文件夹设置为Everyone的权限,首先需要先添加引用 using System.Security.AccessControl; 采用下面的方法对文件夹设置Everyone权限 /// < ...
- [MySql] - 开启外部访问
打开 mysql 的查询窗口(使用root),使用SQL: -- 使用mysql库 use mysql; -- 更新密码 update user set password=PASSWORD('xxxx ...
- 黄聪:jquery 校验中国身份证号码
大陆18位身份证(第二代身份证) 身份号码是一组具有特征组合码,由十七位数字本体码和一位校验码组成. 排列顺序从左至右依次为:六位数字地区码,八位数字生日码,三位数字顺序码和一位数字校验码. 校验方法 ...
- ArcGIS for Flex中引入google map作底图
上篇文章到在ArcGIS View中引入google map,这里讲ArcGIS for Flex中引入google map作底图. 同样道理,以google map作底图,需要编写继承自TiledM ...
- PL/SQL 查找1-100之间的素数
--实现查找1-100之间的素数 declare v_no ; --标记是第几个素数 v_number number; --表示1-100之间的数 v_num number; begin .. loo ...