使用位向量/位操作有哪些优点和缺点?
这个问题是在我在 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论