正在加载图片...
Example of constructor #include <iostream> using namespace std; class Time f public: Time() //the definition of constructor hour-0; minute=0; sec-0; void set_time(); void show time(); private: int hour; /private data members int minute; int sec; 2017年4月26日12时 第9章关于类和对象的进一步讨 论 BACK NEXTHOME2017年4月26日12时 15分 第9章 关于类和对象的进一步讨 论 7 #include <iostream> using namespace std; class Time {public: Time( ) //the definition of constructor { hour=0; minute=0; sec=0; }void set_time( ); void show_time( ); private: int hour; // private data members int minute; int sec; };
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有