91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 2.80KB
    文件類型: .zip
    金幣: 1
    下載: 0 次
    發布日期: 2021-02-21
  • 語言: C/C++
  • 標簽:

資源簡介

C++實戰源碼-訪問類中私有成員的函數(入門級實例216).zip

資源截圖

代碼片段和文件信息

//?Friend.cpp?:?Defines?the?entry?point?for?the?console?application.
//

#include?“stdafx.h“
#include?“ioStream.h“
#include?“string.h“

typedef?char?String[30];

class?CPerson
{
private:
String?name;//姓名
int?age;//年齡
public:
CPerson(String?Nameint?Age)//構造函數
{
strcpy(nameName);
age?=?Age;
}
friend?char?*?GetName(CPerson&p);//定義友員函數
};

char?*?GetName(CPerson&p)//獲取CPerson類私有信息
{
return?p.name;
}

int?main(int?argc?char*?argv[])
{

CPerson?p(“張三“25);
cout?< return?0;
}


?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????573??2010-10-14?14:51??Friend\Friend.cpp
?????文件????????4536??2010-10-14?14:21??Friend\Friend.dsp
?????文件?????????537??2010-10-14?14:21??Friend\Friend.dsw
?????文件?????????293??2010-10-14?14:21??Friend\StdAfx.cpp
?????文件?????????769??2010-10-14?14:21??Friend\StdAfx.h

評論

共有 條評論