Chinaunix首页 | 论坛 | 博客
  • 博客访问: 298345
  • 博文数量: 63
  • 博客积分: 814
  • 博客等级: 军士长
  • 技术积分: 700
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-09 15:46
文章分类

全部博文(63)

文章存档

2017年(1)

2016年(4)

2015年(13)

2014年(9)

2012年(3)

2011年(33)

分类: C/C++

2011-09-17 17:08:07

Type Char        Expected Input        Format of output

Numerics

d        Integer        signed decimal integer
i        Integer        signed decimal integer
o        Integer        unsigned octal integer
u        Integer        unsigned decimal integer
x        Integer        unsigned hexadecimal int (with a, b, c, d, e, f)
X        Integer        unsigned hexadecimal int (with A, B, C, D, E, F)
f        Floating point        signed value of the form [-]dddd.dddd.

e        Floating point        signed value of the form [-]d.dddd or e[+/-]ddd
g        Floating point        signed value in either e or f form, based on given value and precision. Trailing zeros and the decimal point are printed if necessary.
E        Floating point        Same as e; with E for exponent.
G        Floating point        Same as g; with E for exponent if e format used

Characters
c        Character        Single character
s        String pointer        Prints characters until a null-terminator is pressed or precision is reached
%        None        Prints the % character

Pointers
n        Pointer to int        Stores (in the location pointed to by the input argument) a count of the chars written so far.
p        Pointer        Prints the input argument as a pointer; format depends on which memory model was used. It will be either XXXX:YYYY or YYYY (offset only).


    char *cc = "1314847012000000000";
    UINT64 CC =0;
    sscanf(cc,"%lld",&CC);
阅读(878) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~