基础知识理解不到位,不能解决问题,求神回复《对象的引用》
我尝试 很多的大神的指导方法,仍然失败了,仍然不能正确理解并且写出合理的过程,求神 回复。
注:::如果你不能写出过程,只动嘴说:那就请你不要说话了 ,我也不会给你分的,只有写出全部的过程【在原代码的基础上写出正确的代码,方便理解】,并且程序能运行,【这块知识难理解基础差,需要手把手教】我不浪费你的时间,你也别浪费我的分,会的教我,谢谢!!不是太懂的,或者不愿意写详细过程的,请绕过!!!
#include "stdafx.h"
#include<iostream>
#include"Person.h"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int iResult=-1;
CPerson p;
iResult=p.setlndex(25);
if(iResult>=0)
cout<<"m_shAge is :"<<p.getAge()<<endl;
iResult=p.setlndex(0);
if(iResult>=0)
cout<<"m_ilndex is:"<<p.getlndex()<<endl;
char bufTemp[]="Mary";
iResult=p.setName(bufTemp);
if(iResult>=0)
cout<<"m_cName is:"<<p.getName()<<endl;
iResult=p.setSalary(1700.25);
if(iResult>=0)
cout<<"m_dSalary is:"<<p.getSalary()<<endl;
return 0;
}