MFC的 CString 学习笔记 -2

发表于:2007-07-01来源:作者:点击数: 标签:

CString Class Research (2)

 

3. CString Data Buffer

                CString use CStringData structure as a buffer to store data and other information.

struct CStringData

{

                long nRefs;             // reference count

                int nDataLength;        // length of data (including terminator)

                int nAllocLength;       // length of allocation

                // TCHAR data[nAllocLength]

 

                TCHAR* data()           // TCHAR* to managed data

                                { return (TCHAR*)(this+1); }

};

               

A CString Data Buffer (CStringData)

原文转自:http://www.ltesting.net