-
大小: 2.81KB文件類型: .zip金幣: 1下載: 0 次發(fā)布日期: 2021-02-21
- 語言: C/C++
- 標簽:
資源簡介
C++實戰(zhàn)源碼-將結(jié)構(gòu)作為參數(shù)傳遞并返回(入門級實例082).zip
代碼片段和文件信息
//?paramter.cpp?:?Defines?the?entry?point?for?the?console?application.
//
#include?“stdafx.h“
#include?“iostream.h“
struct?Date //日期結(jié)構(gòu)
{
int?monthdayyear;//年月日
};
Date?GetDate(); //獲取日期
void?PrintDate(Date); //輸出日期
int?main(int?argc?char*?argv[])
{
Date?dt?=?GetDate();
PrintDate(dt);
return?0;
}
Date?GetDate()
{
Date?dt?=?{5192010};//定義日期2010-5-19
return?dt;
}
void?PrintDate(Date?dt)
{
//輸出日期
cout?<“日期:“?< < <}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????552??2010-07-02?13:18??paramter\paramter.cpp
?????文件????????4560??2010-07-02?13:11??paramter\paramter.dsp
?????文件?????????541??2010-07-02?13:11??paramter\paramter.dsw
?????文件?????????295??2010-07-02?13:11??paramter\StdAfx.cpp
?????文件?????????769??2010-07-02?13:11??paramter\StdAfx.h
評論
共有 條評論