在:http://www.learncpp.com/cpp-tutorial/82-classes-and-class-members/C++ - 結構...函數參數問題
它下面的代碼:
// Declare a DateStruct variable
DateStruct sToday;
// Initialize it manually
sToday.nMonth = 10;
sToday.nDay = 14;
sToday.nYear = 2020;
// Here is a function to initialize a date
void SetDate(DateStruct &sDate, int nMonth, int nDay, int Year)
{
sDate.nMonth = nMonth;
sDate.nDay = nDay;
sDate.nYear = nYear;
}
// Init our date to the same date using the function
SetDate(sToday, 10, 14, 2020);
什麼是
DateStruct & SDATE的目的
函數符號中的參數特別是我看不到它在函數體中的使用?
謝謝。
請請**請讀一本書**。 – 2011-01-22 12:49:52