摘要:
Time类为例 class Time{ private: int hours; int minutes; Time operator +(const Time &t)const; Time operator -(const Time &t) const; Time operator *(double 阅读全文
摘要:
int global =100;//外部链接,所有文件皆可访问。 static int one_file=50;//内部链接,static关键字,单文件可以使用 void function2(){ static int count=0;//无连接,函数内部使用。静态变量。 } //上述三种变量作用时 阅读全文
摘要:
int x; decltype(x) y; decltype(x+y) xpy;//make xpy the same type as x+y; xpy=x+y; 1.表达式类型不含括号 double x=5.5; double y=7.9; double &rx=x; const double * 阅读全文