January 13th Tuesday 2009 (一月 十三日 火曜日)
来源:互联网 发布:IT. ninepowermylovo 编辑:程序博客网 时间:2024/05/02 12:07
These days we have to work until 9 o'clock at night. Two of our team began to learn how to implement a user interface
in Java. Today I have to check and learn the code written by them.
The winter still remains. The Spring Festival is coming, it also bring us more fatigues. After fight all day and all
night, we did not get a rest before the festival.
Why I can choose the tried and poor vocation?
//fr.cpp
#include <unistd.h>
#include <string.h>
#include <iostream>
using namespace std;
#define MSTRING_MAX 256
class MString {
private:
char *buf;
public:
MString() {
buf = new char[MSTRING_MAX];
memset(buf, 0, sizeof(buf));
}
MString(char *str, int str_len) {
buf = new char[MSTRING_MAX];
memset(buf, 0, sizeof(buf));
strncpy(buf, str, str_len);
}
~MString() { delete buf; }
char * getChars() { return buf; }
friend int operator>(const MString& str1, const MString& str2);
};
int operator> (const MString& str1, const MString& str2) {
return (strcmp(str1.buf, str2.buf) > 0) ? 1 : 0;
}
int main() {
MString mstr1("abc", 3);
MString mstr2("luming", 6);
cout<<mstr1.getChars()<<endl;
cout<<mstr2.getChars()<<endl;
cout<<(mstr1>mstr2)<<endl;
sleep(10000);
return 0;
}
//const_cast<> example
const char *klingongreeting = "hello";
size_t length = strlen(const_cast<char*>(klingongreeting));
- January 13th Tuesday 2009 (一月 十三日 火曜日)
- Februray 13th Tuesday (一月 十三日 火曜日)
- January 6th Tuesday 2009 (一月 六日 火曜日)
- January 23th Friday 2009 (一月 二十三日 金曜日)
- 2008 January 8th Tuesday (一月 八日 火曜日)
- 2008 January 15th Tuesday (一月 十五日 火曜日)
- 2008 January 22th Tuesday (一月 二十二日 火曜日)
- March 13th Tuesday (三月 十三日 火曜日)
- 2008 January 23th Wednesday (一月 二十三日 水曜日)
- 2008 May 13th Tuesday (五月 十三日 火曜日)
- December 13th Tuesday (十二月 十三日 木曜日)
- February 6th Tuesday (一月 六日 火曜日)
- October 23th Tuesday (十月 二十三日 火曜日)
- 2008 September 23th Tuesday (九月 二十三日 火曜日)
- June 23th Tuesday (六月 二十三日 火曜日)
- Tuesday 5th January 2010
- January 7th Tuesday 2010
- January 12th Tuesday 2010
- January 9th Friday 2009 (一月 九日 金曜日)
- January 12th Monday 2009 (一月 十二日 月曜日)
- 幼儿英语100句
- Oracle学习笔记十:监听程序及服务的配置
- Windows XP中当最小化程序时,无法在任务栏显示图标的问题
- January 13th Tuesday 2009 (一月 十三日 火曜日)
- January 14th Wednesday 2009 (一月 十四日 水曜日)
- 新年前的自语
- January 15th Thursday 2009 (一月 十五日 木曜日)
- Oracle学习笔记十一:数据库的备份和恢复
- 密码字典生成工具
- January 19th Monday 2009 (一月 十九日 月曜日)
- January 21th Wednesday 2009 (一月 二十一日 水曜日)
- January 22th Thursday 2009 (一月 二十二日 木曜日)