是什么\\×平均在C / C ++? [英] What does \x mean in c/c++?

查看:129
本文介绍了是什么\\×平均在C / C ++?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

char arr[]= "\xeb\x2a";

顺便说一句,这些相同的:

BTW,are these the same:

\\ XEB \\ X2A VS '\\ XEB \\ X2A'

推荐答案

\\ X 表示十六进制字符转义。它用于指定未typeable字符(如空'\\ X00')。

\x indicates a hexadecimal character escape. It's used to specify characters that aren't typeable (like a null '\x00').

\\ XEB \\ X2A是一个字符串(类型为的char * ,3个字节,空封端)和'\\ XEB \\ X2A'是一个字符常量(类型是 INT ,2个字节,不空值终止,而只是另一种方式来写0xEB2A或60202或0165452)。不一样的:)

And "\xeb\x2a" is a literal string (type is char *, 3 bytes, null-terminated), and '\xeb\x2a' is a character constant (type is int, 2 bytes, not null-terminated, and is just another way to write 0xEB2A or 60202 or 0165452). Not the same :)

这篇关于是什么\\×平均在C / C ++?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆