该文被密码保护。 阅读全文
posted @ 2013-05-23 21:45 herizai 阅读(0) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2013-05-23 21:22 herizai 阅读(0) 评论(0) 推荐(0) 编辑
摘要: C++ 1 #include<iostream> 2 #include<ctime> 3 using namespace std; 4 int day_tab[2][12]={{31,28,31,30,31,30,31,31,30,31,30,31},{31,28,31,30,31,30,31,31,30,31,30,31}}; 5 class Date 6 { 7 int year; 8 int month; 9 int day;10 public:11 Date()//默认构造函数:获取当前日期12 {13 char tmpbuf[1... 阅读全文
posted @ 2013-05-23 19:53 herizai 阅读(382) 评论(0) 推荐(0) 编辑
摘要: 当参数为非const引用时,编译器就认为这个参数必须是可以修改的。_strdate参数datestr 05_23_12必须指向一个格式化的时间字符串(A pointer to a buffer containing the formatted date string)不能为空char *_strda... 阅读全文
posted @ 2013-05-23 19:51 herizai 阅读(294) 评论(0) 推荐(0) 编辑
摘要: //字符串连接函数char*strcat(char *strDestination,const char *strSource);strcat函数将字符串strSource连接到字符串strDestination,并且在strDestination字符串末尾添加NULL字符。函数结果会改变字符串strDestination,其将用来存储连接之后的字符串。函数不对内存溢出进行检查,所以要确保strDestination指向的空间足够长,以存储连接之后的字符串。如果strDestination和strSource指向的地址有重叠,函数结果未定义(不可预期)。返回值:strcat函数返回目标字符串的 阅读全文
posted @ 2013-05-23 17:20 herizai 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 1 VC6.0 2 3 #include<iostream> 4 using namespace std; 5 class MyClass2 6 { 7 int n; 8 public: 9 MyClass2(int i){n=i;}10 operator ++(){n++;}//vc6.0支持,vs2012不支持11 operator++(int){n+=2;}12 void display()13 {14 cout<<"n="<<n<<endl;15 }16 };17 void main()18 {19 MyClass2 阅读全文
posted @ 2013-05-23 16:51 herizai 阅读(227) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2013-05-23 16:31 herizai 阅读(0) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;void main(){ char c; for(int n;cin>>c>>n;) { for(int i=1;i<=n;++i) cout<<string(n-i,' ')+string(2*i-1,c)+'\n'; for(int i=1;i<n-1;++i) cout<<string(i,' ')+string(2*n-1-2*i,c)+'\n'; }}#include< 阅读全文
posted @ 2013-05-23 14:17 herizai 阅读(127) 评论(0) 推荐(0) 编辑
摘要: // icmpscanning.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include "winsock2.h"#pragma comment(lib,"ws2_32.lib")typedef struct lpHeader{ unsigned char Version_HLen;//首部长度 ,ip 版本号 unsigned char TOS; //服务类型tos unsigned short Length;//总长度 unsigned short Ident;//标示 unsigned 阅读全文
posted @ 2013-05-23 14:13 herizai 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 1 void input() 2 { 3 int row=3,col=3;//resize(),设置大小(size);reserve(),设置容量(capacity);size()是分配容器的内存大小, 4 //而capacity()只是设置容器容量大小,但并没有真正分配内存。 5 //打个比方:正在建造的一辆公交车,车里面可以设置40个座椅(reserve(40);),这是它的容量, 6 //但并不是说它里面就有了40个座椅,只能说明这部车内部空间大小可以放得下40张座椅而已。而车里面安装了40个座椅(resize(40);), 7 //这个时候车里面才真正有了40个座椅,这... 阅读全文
posted @ 2013-05-23 14:12 herizai 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 1 #include<iostream> 2 #include<iomanip> 3 using namespace std; 4 class Matrix 5 { 6 int a[2][3]; 7 public: 8 Matrix(){}; 9 void setMatrixa();10 void setMatrixb();11 void getMatrix();12 friend Matrix operator+(Matrix& t,Matrix temp);13 };14 void Matrix::setMatrixa()15 {16 cout<< 阅读全文
posted @ 2013-05-23 12:22 herizai 阅读(190) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2013-05-23 12:09 herizai 阅读(0) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2013-05-23 12:08 herizai 阅读(0) 评论(0) 推荐(0) 编辑