0x0D,0x0A,0x1A诀别指的是什么
发布时间:2011-06-28 13:27:25 文章来源:www.iduyao.cn 采编人员:星星草
0x0D,0x0A,0x1A分别指的是什么?
0x0D,0x0A,0x1A分别指的是什么?
------解决方案--------------------
分别指的十进制的 13 10 26.........
------解决方案--------------------
0x0A LF 表示换行
0x0D CR 表示回车
0x1A SUB 在文本文件中表示文件结果
------解决方案--------------------
OX开头代表十六进制
A 是10
B 11
C 12
D 13
E 14
F 15
0x0D,0x0A,0x1A
13 10 31 (00011111)
------解决方案--------------------
0x0D,0x0A,0x1A这是16进制的表示,A = 10,进位为16的幂,所以分别为上面所说的13,10,26
------解决方案--------------------
16进制呀
------解决方案--------------------
如果对应于ASCII码,分别是
回车符,换行符,CTRL+Z
------解决方案--------------------
当然是表示16进制数了,晕,0xA-0xF表示十进制的10-15,0x1A=1*16+10=26
------解决方案--------------------
《计算机组成原理》
和C语言数字常量语法:
C++ Integer Constants
Integer constants are constant data elements that have no fractional parts or exponents. They always begin with a digit. You can specify integer constants in decimal, octal, or hexadecimal form. They can specify signed or unsigned types and long or short types.
Syntax
integer-constant :
decimal-constant integer-suffixopt
octal-constant integer-suffixopt
hexadecimal-constant integer-suffixopt
'c-char-sequence'
decimal-constant :
nonzero-digit
decimal-constant digit
octal-constant :
0
octal-constant octal-digit
hexadecimal-constant :
0x hexadecimal-digit
0X hexadecimal-digit
hexadecimal-constant hexadecimal-digit
nonzero-digit : one of
1 2 3 4 5 6 7 8 9
octal-digit : one of
0 1 2 3 4 5 6 7
hexadecimal-digit : one of
0 1 2 3 4 5 6 7 8 9
a b c d e f
A B C D E F
integer-suffix :
unsigned-suffix long-suffixopt
long-suffix unsigned-suffixopt
unsigned-suffix : one of
u U
long-suffix : one of
l L
64-bit integer-suffix :
i64
To specify integer constants using octal or hexadecimal notation, use a prefix that denotes the base. To specify an integer constant of a given integral type, use a suffix that denotes the type.
To specify a decimal constant, begin the specification with a nonzero digit. For example:
int i = 157; // Decimal constant
int j = 0198; // Not a decimal number; erroneous octal constant
int k = 0365; // Leading zero specifies octal constant, not decimal
To specify an octal constant, begin the specification with 0, followed by a sequence of digits in the range 0 through 7. The digits 8 and 9 are errors in specifying an octal constant. For example:
int i = 0377; // Octal constant
int j = 0397; // Error: 9 is not an octal digit
To specify a hexadecimal constant, begin the specification with 0x or 0X (the case of the “x” does not matter), followed by a sequence of digits in the range 0 through 9 and a (or A) through f (or F). Hexadecimal digits a (or A) through f (or F) represent values in the range 10 through 15. For example:
int i = 0x3fff; // Hexadecimal constant
int j = 0X3FFF; // Equal to i
To specify an unsigned type, use either the u or U suffix. To specify a long type, use either the l or L suffix. For example:
unsigned uVal = 328u; // Unsigned value
long lVal = 0x7FFFFFL; // Long value specified
// as hex constant
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。
其他相似内容:
-
【★C/C++奖励基金-30期★】更新获奖书籍,请选择~ - C/C++ / 非技术区
【★C/C++奖励基金-30期★】
C/C++ 2011-12专家榜
名次...
-
C/c++ 如何按位拷贝呢?
我有一个结构体
strut st_header
{
unsigned short ver:2
unsigned short ping:1
unsgne...
-
uboot上的一点代码,没看明白!
struct in_str {
const char *p;
#ifndef __U_BOOT__
char peek_buf[2];
#endif
int __promptme;
...
-
Debug时为什么变量的地址不变?
是巧合还是某种必然. 是不是因为C中生成的可执行程序存储的地址是相对地址而不是绝对的物理地址.
...
-
关于switch语句。我不知道哪里错了,大侠帮忙bug一下
#include <stdio.h>
int main()
{
int a;
char b;
do{
printf("1.Chines...
-
#pragma section 的 $ 语法
在 ARX 头文件中间过如下三行,放在一起:
#pragma section("ARXCOMMAND$__a")
#pragma section("ARXCOMM...
-
read 问题再现
#define N 205
signed short x[N];
for(i=0;i<N;i++)
{
printf("hello boy!!\n");
...
-
征求一个C语言输入函数?
不知道大家有没有学习过Java? 现在需要一个类似Java的Scanner的函数集, 要求如下:
1. 三个函数: int rea...
-
求一道算法。一个整数,它加上100后是一个完全平方数,再加上168又是一个完全平方数,请问该数是多少?
/*我写了一点,但是有错误,汗*/
/*
...
-
3n+1问题
求救,不知道错在哪里
#include<stdio.h>
int count(int a,int b)
{
int max=0,len=0,a1;
while(a<=b)
{
...