|
[讨论]钱林松深拷贝构造函数一章求解
源代码 #include <iostream> using namespace std; class CMyString{ public: CMyString(){ m_pString=NULL; } CMyString(CMyString&obj){ int nLen=strlen(obj.m_pString); this->m_pString=new char[nLen+sizeof(char)]; strcpy(this->m_pString,obj.m_pString); } ~CMyString(){ if(m_pString!=NULL) { delete[] m_pString; m_pString=NULL; } } void SetString(char* pString){ int nLen=strlen(pString); if(m_pString!=NULL) { delete [] m_pString; m_pString =NULL; } m_pString=new char[nLen+sizeof(char)]; strcpy(m_pString,pString); } char*m_pString; }; void Show(CMyString MyString){ printf(MyString.m_pString); } int main(int argc,char*argv[]){ CMyString MyString; MyString.SetString("Hello"); Show(MyString); return 0; } 这个是源代码直接在里面看反汇编生成的, 断点在Show(MyString);处 |
|
[讨论]钱林松深拷贝构造函数一章求解
00401169 push ecx处的push ecx是把ecx中的数值压时栈,但是此时ecx的数值并不是为空,原先的ecx数值跑哪儿去了,原先的值为00431024 |
|
[讨论]钱林松深拷贝构造函数一章求解
如果是main早就在main那段说明了,但是为什么用esp里存放着参数对象的地址,并把他放在[ebp-14h]中,ebp偏移14h呢 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值