我读到这个转义序列, \\ XNN 在 C 用于重新使用十六进制字符codeS或值present单个字符。我能得到这个转义序列的一个简单的例子程序,对于我不知道如何来实现它,因为我不是它的目的非常明确。
解决方案我能得到这个转义序列的一个简单的示例程序
的char * s =ABC;也可以是codeD为:
的char * s =\\ X61 \\ X62 \\ X63
我不是它的目的非常明确。
在除了可以容易地输入通常的字符,在C11标准确定了以下的简单转义序列取值:
\\'\\\\ \\\\?\\ A \\ B \\ F \\ n \\ r \\ t符\\ v如果一个字符不容易输入的,它不能被重新使用简单转义序列之一psented $ P $,你将有使用诉诸 \\ XNN (十六进制转义序列)或 \\ NNN (八进制转义序列)。
I read that this escape sequence, \xnn, in C is used to represent single characters using hexadecimal character codes or values. Can I get a simple example program of this escape sequence, for I'm not sure on how to implement it, for I'm not quite clear on its purpose.
解决方案Can I get a simple example program of this escape sequence
char* s = "abc";
can also be coded as:
char* s = "\x61\x62\x63";
I'm not quite clear on its purpose.
In addition to the usual characters that can be typed easily, the C11 standard identifies the following simple-escape-sequences:
\' \" \? \\ \a \b \f \n \r \t \vIf a character cannot be typed easily and it cannot be represented by using one of the simple escape sequences, you will have to resort the using \xnn (hexadecimal escape sequence) or \nnn (octal escape sequence).
更多推荐
在C \\ XNN转义序列
发布评论