<串GT;有Null-Bytes支持的课程? [英] <string> class with support of Null-Bytes?

查看:76
本文介绍了<串GT;有Null-Bytes支持的课程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!


之前我问了一个类似的问题,但后来改为使用

char-Arrays而不是字符串类,但我宁愿不要这样做

再次。


那么,有没有人知道类似于STL-< string>的字符串类那个

支持空字节?


我试过标准< string>但这肯定不支持

他们...... :(


Tnx

Karl

Hi!

I asked a similar question before but then changed everything to using
char-Arrays instead of the string class, but I would rather not do this
again.

So, does anyone know of a string-Class similar to the STL-<string> that
supports null-bytes?

I tried with standard <string> but this definitely does not support
them... :(

Tnx
Karl

推荐答案

* Karl Ebener:
* Karl Ebener:

之前我问了一个类似的问题但后来改变了一切使用了
char-Arrays而不是字符串类,但我宁愿不再这样做

所以,有没有人知道类似于STL-< string>的字符串类,它支持
null-bytes?

我尝试使用标准< string>但这肯定不支持
他们...... :(

I asked a similar question before but then changed everything to using
char-Arrays instead of the string class, but I would rather not do this
again.

So, does anyone know of a string-Class similar to the STL-<string> that
supports null-bytes?

I tried with standard <string> but this definitely does not support
them... :(




取决于您所说的支持,但通常的定义是'

不正确。


也许发布一个简单的程序,显示你的意思是不支持?


然后我们可以看到问题是在代码中还是用std :: string,

然后给出关于如何处理的更好的建议。


-

答:因为它弄乱了人们通常阅读文字的顺序。

问:为什么这么糟糕?

答:热门发布。

问:usenet和电子邮件中最烦人的事情是什么?



Depends what you mean by "support", but with usual definitions that''s
not correct.

Perhaps post a simple program that shows what you mean by "not support"?

Then we can see whether the problem is in the code or with std::string,
and give better suggestions on how to proceeed.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?


变化不大:
Little change:
我尝试使用标准< string>但这肯定不支持
他们...... :(
I tried with standard <string> but this definitely does not support
them... :(




- >我尝试使用length() - 停止在null-bytes的方法c_str()

当然只提取部分直到空字节。

我只是没有看到任何可能将内容提取为char *?


Tnx

Karl



-> I tried using length()-method which stops at null-bytes and c_str()
of course extracts only part till null-byte.
Have I only not seen any possibility to extract the content as char* ?

Tnx
Karl


* Karl Ebener:
* Karl Ebener:
变化不大:
Little change:
我尝试使用标准< string>但这肯定不支持
他们...... :(
- >我尝试使用length() - 方法停止在null-bytes
I tried with standard <string> but this definitely does not support
them... :(
-> I tried using length()-method which stops at null-bytes




它没有。


和c_str()当然只提取部分直到空字节。


它没有,见§21.3.6/ 1.


我还没有看到任何提取内容的可能性作为char *?



It doesn''t.

and c_str() of course extracts only part till null-byte.
It doesn''t, see §21.3.6/1.

Have I only not seen any possibility to extract the content as char* ?




发布一些代码。


-

答:因为它搞砸了人们通常阅读文字的顺序。

问:为什么这么糟糕?

A:热门发布。

问: usenet和电子邮件中最烦人的事情是什么?



Post some code.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?


这篇关于&LT;串GT;有Null-Bytes支持的课程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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