資源簡介
C++實戰源碼-將結構作為參數傳遞并返回(入門級實例082).zip
代碼片段和文件信息
//?paramter.cpp?:?Defines?the?entry?point?for?the?console?application.
//
#include?“stdafx.h“
#include?“iostream.h“
struct?Date //日期結構
{
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
- 上一篇:C++實戰源碼-獲取用戶輸入的用戶名
- 下一篇:C++實戰源碼-祖先的止癢藥方
評論
共有 條評論