长度指示符 | 转换规范 | 转换为某种类型的二进制 |
---|---|---|
hh | d | char |
h | d | short |
无 | d | int |
l | d | long |
ll | d | long long |
hh | u | unsigned char |
h | u | unsigned short |
无 | u | unsigned int |
l | u | unsigned long |
ll | u | unsigned long long |
无 | f | float |
l | f | double |
无 | c | 字符对应的ASCLL码 |
无 | s | 字符串中字符对应的ASCLL码 |
#include <stdio.h>
int main()
{
char c;
short s;
int n;
long l;
float f;
double df;
scanf("%hhd %hd %d %ld %f %lf",&c,&s,&n,&l,&f,&df); //后面加&是将转化后的二进制存储到基础变量中
printf("%d %d %d %d %f %f\n", c, s, n, l, f, df);
return 0;
}
SACLL码表
SACLL