65,210
社区成员
发帖
与我相关
我的任务
分享
class MyCString
{
char m_buffer[100];
char * char *()
{
return m_buffer;
}
}
Example
The following example demonstrates the use of CString::GetBuffer.
// example for CString::GetBuffer
CString s( "abcd" );
#ifdef _DEBUG
afxDump << "CString s " << s << "\n";
#endif
LPTSTR p = s.GetBuffer( 10 );
strcpy( p, "Hello" ); // directly access CString buffer
s.ReleaseBuffer( );
#ifdef _DEBUG
afxDump << "CString s " << s << "\n";
#endif