2011年11月15日
摘要: #include <iostream>using namespace std;int main(){int a=21;cout.setf(ios::showbase);cout<<"dec:"<<a<<endl;cout.unsetf(ios::dec);cout.setf(ios::hex);cout<<"hex:"<<a<<endl;cout.unsetf(ios::hex);cout.setf(ios::oct);cout<<"oct:&quo 阅读全文
posted @ 2011-11-15 18:42 Gavin Dai 阅读(227) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>using namespace std;class Time{public: Time(){minute=0;sec=0;} Time(int m,int s):minute(m),sec(s){} Time operator++(); Time operator++(int); void display(){cout<<minute<<":"<<sec<<endl;} private: int minute; int sec;};Time Time::operator++() 阅读全文
posted @ 2011-11-15 16:57 Gavin Dai 阅读(355) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <string>using namespace std;class String{public: String(){p=NULL;} String(char *str); friend bool operator>(String &string1,String &string2); friend bool operator<(String &string1,String &string2); friend bool operator==(String &strin 阅读全文
posted @ 2011-11-15 16:32 Gavin Dai 阅读(262) 评论(0) 推荐(0) 编辑