什么是斑点?
我看到了几篇提到 C++ blob 的文章。这是什么?
我见过一些这样使用它的代码:
char blob[100];
element = lst->putBlob(blob, strlen(blob));
代码在这里并不重要,我只是想知道“blob”是什么。
I came across a few articles referring to a C++ blob. What this is?
I have seen some code that uses it like this:
char blob[100];
element = lst->putBlob(blob, strlen(blob));
The code is not really important here, I just want to know what a "blob" is.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“blob”是“Binary Large Object”的常见缩写,这意味着它是保存大量二进制数据的对象。有些语言具有本机 blob 类型,但 C++ 没有。尽管如此,创建 blob 非常简单 - 您只需创建一个字节数组即可。在您的示例中,这是通过创建 char 数组来完成的。不过,这可能会令人困惑,因为字符数组在 C++ 中具有特殊含义 - 它也是一个字符串。不过,如果用作 blob,它可以保存任何类型的数据(在这种情况下
strlen
将不起作用)。A "blob" is a common acronym for "Binary Large Object", which means it's an object holding a large amount of binary data. Some languages has native blob types, but C++ doesn't. Never the less, creating a blob is simple enough - you just create an array of bytes. In your example, this is done by creating an array of
char
s. This might be confusing, though, as an array of chars has a special meaning in C++ - it's also a string. Still, if used as a blob, it can hold any kind of data (in which casestrlen
won't work).“Blob”代表二进制大型对象。
"Blob" stands for Binary large object.