在: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