如何知道缓冲区大小并增加c ++中的缓冲区大小 [英] How to know the buffer size and increase buffer size in c++

查看:128
本文介绍了如何知道缓冲区大小并增加c ++中的缓冲区大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何知道缓冲区大小并增加c ++中的缓冲区大小。

解决方案



" Raja" < SH ******* @ yahoo.com>在消息中写道

news:b2 ************************* @ posting.google.co m ... < blockquote class =post_quotes>如何知道缓冲区大小并增加c ++中的缓冲区大小。




缓冲区大小是什么?


john




" Raja" < SH ******* @ yahoo.com>在消息中写道

news:b2 ************************* @ posting.google.co m ... < blockquote class =post_quotes>如何知道缓冲区大小


决定你想要的大小,并记住它。

并增加c ++中的缓冲区大小。




在上面添加所需的金额,并且

将其更改为新的大小。


也许如果你更具体,我们可以给你一个更具体的答案。

-Mike


Raja写道:


如何知道缓冲区大小并增加c ++中的缓冲区大小。




没有C ++中的内在支持能够确定一个任意分配的内存块(缓冲区?)的大小。你必须跟踪内存

自己阻止。


要增加大小(必要时),你只需要分配一个新的部分

的内存大小合适,复制过去的内容为

新的,更新前面的引用指向新的,然后

发布前一个。


How to know the buffer size and increase buffer size in c++.

解决方案


"Raja" <sh*******@yahoo.com> wrote in message
news:b2*************************@posting.google.co m...

How to know the buffer size and increase buffer size in c++.



Buffer size of what?

john



"Raja" <sh*******@yahoo.com> wrote in message
news:b2*************************@posting.google.co m...

How to know the buffer size
Decide what size you want, and remember that.
and increase buffer size in c++.



Add the desired amount to the above, and
change it to the new size.

Perhaps if you''d be more specific, we could
give a more specific answer.
-Mike


Raja wrote:


How to know the buffer size and increase buffer size in c++.



There is no intrinsic support in C++ to be able to determine the size of an
arbitrary allocated memory block (buffer?). You must keep track of the memory
block yourself.

To increase the size (when necessary), you simply need to allocate a new piece
of memory that is of suitable size, copy over the contents of the previous to
the new, update references to the previous to point to the new, and then
release the previous.


这篇关于如何知道缓冲区大小并增加c ++中的缓冲区大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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