128位十六进制数--->字串缓冲区 [英] 128-bit hex number ---> string buffer

查看:136
本文介绍了128位十六进制数--->字串缓冲区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否存在将128位十六进制数转换为字符串的函数?

Does a function exist to convert a 128-bit hex number to a string?

推荐答案

ern说:
ern said:

是否存在将128位十六进制数转换为字符串的函数?
Does a function exist to convert a 128-bit hex number to a string?



没有十六进制数这样的东西。十六进制是一个数字

表示系统,而不是一种数字。


如果你有一个十六进制表示,你已经*有一个字符串,并且

将字符串转换为字符串很简单。


-

Richard Heathfield

" ; Usenet是一个奇怪的地方 - dmr 29/7/1999
http://www.cpax.org.uk

电子邮件:rjh在上面的域名(但显然放弃了www)

There is no such thing as a "hex number". Hexadecimal is a numeric
representation system, not a kind of number.

If you have a hex representation, you already *have* a string, and
converting a string to a string is simple enough.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)


" ern" < er ******* @ gmail.comwrites:
"ern" <er*******@gmail.comwrites:

是否存在将128位十六进制数转换为字符串的函数?
Does a function exist to convert a 128-bit hex number to a string?



开始时的数字是什么格式?我问,因为

指定一个数字是十六进制是奇怪的,如果它只是在一个整数变量中的
。通常,人们认为数字变量

只是有一个值,而且基数并不重要。另外:C

并不保证存在128位整数类型。

-

我错过了什么?"

--Dan Pop

What format is the number in to start out with? I ask because
it''s strange to specify that a number is in hex if it''s simply in
an integer variable. Normally, one thinks of a numeric variable
as simply having a value, and the base is not important. Also: C
doesn''t guarantee the existence of an 128-bit integer type.
--
"Am I missing something?"
--Dan Pop




Richard Heathfield写道:

Richard Heathfield wrote:

ern说:
ern said:

是否存在将128位十六进制数转换为字符串的函数?
Does a function exist to convert a 128-bit hex number to a string?



没有十六进制数这样的东西。十六进制是一个数字

表示系统,而不是一种数字。


如果你有一个十六进制表示,你已经*有一个字符串,并且

将字符串转换为字符串很简单。


-

Richard Heathfield

" ; Usenet是一个奇怪的地方 - dmr 29/7/1999
http://www.cpax.org.uk

电子邮件:rjh在上面的域名(但显然放弃了www)


There is no such thing as a "hex number". Hexadecimal is a numeric
representation system, not a kind of number.

If you have a hex representation, you already *have* a string, and
converting a string to a string is simple enough.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)



让我改写一下。我有一个128位的值,我希望将它变成一个十六进制表示的字符串。


例如,


如果我的128位值(以十六进制表示)是:


4D9479E256DD4E8A923E32065141A911



charBuffer =" 4D9479E256DD4E8A923E32065141A911"

Let me rephrase. I have a 128 bit value, which I would like to be
converted to a hexadecimally represented string.

For example,

If my 128 bit value (represented hexadecimally) was:

4D9479E256DD4E8A923E32065141A911

I would want this function to populate a char buffer such that:

charBuffer = "4D9479E256DD4E8A923E32065141A911"


如果你有一个十六进制表示,你已经*有*一个字符串,并且

将字符串转换为字符串很简单。
If you have a hex representation, you already *have* a string, and
converting a string to a string is simple enough.



上次检查时... http://www.asciitable.com/


字符串表示4具有十六进制值0x34,与上述语句相矛盾。你*总是*有一个字符串(如在这个
的情况下)它可能不是你需要的那个。

Last time I checked... http://www.asciitable.com/

the string representation "4" has the hex value 0x34, contradicting
your above statement. You *always* have a string, though (as in this
case) it might not be the one you need.


这篇关于128位十六进制数---&gt;字串缓冲区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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