各知识点2

来源:互联网 发布:淘宝投资要多少钱 编辑:程序博客网 时间:2024/06/05 15:50


int Programer :: f_compute(int a,int b)
{
int result = a + b;
return result;
}


int Programer::setAge() const
{
Programer *pProgram = (Programer*)this;
pProgram->age = 20;
return age;
}


void Programer::unknown1()
{
cout <<"this is a unknown class" <<endl;
}


int  first()
{
Programer st("jack",28627,30);
st.f_compute(1,2);
st.setAge();
st.print();


st.say();
Person *p = new Programer();
p->say();


st.unknown1();
st.birthyear(40);


return 0;
}



0 0
原创粉丝点击