date.h

来自「data+structures+using+c的源码」· C头文件 代码 · 共 38 行

H
38
字号
#ifndef date_H
#define date_H

class dateType
{
public:
    void setDate(int month, int day, int year);
		//Function to set the date.
		//Data members dMonth, dDay, and dYear are set 
		//according to the parameters
		//Postcondition: dMonth = month; dDay = day;
		// 		    dYear = year

	void getDate(int& month, int& day, int& year);
		//Function to return the date.
		//Postcondition: month = dMonth; day = dDay;
		//		    year = dYear

    void printDate() const;
		//Function to output the date in the form mm-dd-yyyy.

    dateType(int month = 1, int day = 1, int year = 1900);
		//Constructor to set the date
		//Data members dMonth, dDay, and dYear are set 
		//according to the parameters
		//Postcondition: dMonth = month; dDay = day; 
		//                	dYear = year
		//If no values are specified, the default values are 
		//used to initialize the data members.

private:
    int dMonth;		//variable to store the month
    int dDay;		//variable to store the day
    int dYear;		//variable to store the year
};


#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?