使用位向量/位操作有哪些优点和缺点?

发布于 2025-01-09 05:30:35 字数 138 浏览 3 评论 0原文

这个问题是在我在 C 中使用位向量时出现的。据我所知,它们很好用,因为它们允许您存储相同的数据但占用更少的内存,尽管我可能是错的。但是,我发现打印该数据时的结果可能会令人困惑,我不知道终端中打印的数字代表什么,因为它们已被操纵。那么为什么你会或不会使用位向量呢?

This question came up while I was working with bitvectors in C. From what I understand, they're good to use since they allow you to store the same data but with less memory, although I could be wrong. However, I find that the outcome when printing that data can be confusing, I don't know what the numbers being printed in the terminal represent since they've been manipulated. So why would you or would you not use bitvectors?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文