CString
-
Hi , When i try to do as follows. CString strString=_T("testing"); int nSize=sizeof(strString); now nSize gets a value =4; how the size is getting 4 strString is a pointer..? i guess it is an object... Please clarify..
-
Hi , When i try to do as follows. CString strString=_T("testing"); int nSize=sizeof(strString); now nSize gets a value =4; how the size is getting 4 strString is a pointer..? i guess it is an object... Please clarify..
p_1960 wrote:
i guess it is an object...
No need to guess:
CString
is aATL/MFC
class [^]. A class instance is an object. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
p_1960 wrote:
i guess it is an object...
Yes... :) If you look into the code of CString you will get the answer.
- ns ami -
-
The size of a class object is the sum of size of all the non static members. If you check the CString class (as I told before) you can find only one member inside it. ie., LPTSTR m_pchData;
- ns ami -
-
Hi , When i try to do as follows. CString strString=_T("testing"); int nSize=sizeof(strString); now nSize gets a value =4; how the size is getting 4 strString is a pointer..? i guess it is an object... Please clarify..