CString::FreeExtra
void FreeExtra( );
Remarks
Call this member function to free any extra memory previously allocated by the string but no longer needed. This should reduce the memory overhead consumed by the string object. The function reallocates the buffer to the exact length returned by GetLength.
Example
The following example prints the three lines shown below under Output.
Output
Alloc length is 1024, String length is 1024
Alloc length is 1024, String length is 15
Alloc length is 64, String length is 15
http://msdn.microsoft.com/en-us/library/aa314336(VS.60).aspx
本文详细介绍了CString::FreeExtra函数的使用方法及其效果。通过示例代码展示了如何减少字符串对象的内存开销,并解释了该函数如何重新分配缓冲区以匹配实际长度。
985

被折叠的 条评论
为什么被折叠?



