本文介绍了如何知道缓冲区大小并增加c ++中的缓冲区大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 如何知道缓冲区大小并增加c ++中的缓冲区大小。 解决方案 缓冲区大小是什么? john 在上面添加所需的金额,并且 将其更改为新的大小。 也许如果你更具体,我们可以给你一个更具体的答案。 -Mike 没有C ++中的内在支持能够确定一个任意分配的内存块(缓冲区?)的大小。你必须跟踪内存 自己阻止。 要增加大小(必要时),你只需要分配一个新的部分 的内存大小合适,复制过去的内容为 新的,更新前面的引用指向新的,然后 发布前一个。 How to know the buffer size and increase buffer size in c++. 解决方案Buffer size of what?johnAdd the desired amount to the above, andchange it to the new size.Perhaps if you''d be more specific, we couldgive a more specific answer.-MikeThere is no intrinsic support in C++ to be able to determine the size of anarbitrary allocated memory block (buffer?). You must keep track of the memoryblock yourself.To increase the size (when necessary), you simply need to allocate a new pieceof memory that is of suitable size, copy over the contents of the previous tothe new, update references to the previous to point to the new, and thenrelease the previous. 这篇关于如何知道缓冲区大小并增加c ++中的缓冲区大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!