上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 38 下一页
摘要: 动态映射 安全类型向下映射 #include <iostream> #include <stdlib.h> #include <time.h> #include <vector> using namespace std; class shape{ public: shape() { count++; 阅读全文
posted @ 2015-06-15 11:52 SandKing 阅读(4) 评论(0) 推荐(0)
摘要: 运算符的重载 1. 友元 2. 内部 #include <iostream> using namespace std; class CTmp{ public: //friend const CTmp operator++(CTmp& tmp); //friend const CTmp operato 阅读全文
posted @ 2015-06-15 11:49 SandKing 阅读(3) 评论(0) 推荐(0)
摘要: 输入输出流的现实设置 #include <iostream> #include <fstream> #include <iomanip> using namespace std; /* 使用setprecision(n)可控制输出流显示浮点数的数字个数。C++默认的流输出数值有效位是6。 如果set 阅读全文
posted @ 2015-06-15 11:47 SandKing 阅读(12) 评论(0) 推荐(0)
摘要: 友元类的一种设计 #include <stdio.h> #include <string.h> #define SZ 20 struct holder{ private: int a[SZ]; public: void initialize(); struct pointer{ private: h 阅读全文
posted @ 2015-06-15 11:46 SandKing 阅读(3) 评论(0) 推荐(0)
摘要: 字符串分割 字符串和值得转换 #include <iostream> #include <vector> #include <string> #include <sstream> using namespace std; template<typename T> const char* to_str 阅读全文
posted @ 2015-06-15 11:43 SandKing 阅读(6) 评论(0) 推荐(0)
摘要: 格式化输入输出 #include <iostream> #include <stdarg.h> #include <string.h> #include <string> using namespace std; void print(const char* s1, ...) { va_list a 阅读全文
posted @ 2015-06-15 11:33 SandKing 阅读(9) 评论(0) 推荐(0)
摘要: #include <iostream> using namespace std; class CTmp{ public: //friend const CTmp operator++(CTmp& tmp); //friend const CTmp operator++(CTmp& tmp, int) 阅读全文
posted @ 2015-06-12 16:36 SandKing 阅读(6) 评论(0) 推荐(0)
摘要: #include <iostream> #include <vector> #include <string> #include <sstream> using namespace std; template<typename T> const char* to_string(T number) { 阅读全文
posted @ 2015-06-11 15:05 SandKing 阅读(5) 评论(0) 推荐(0)
摘要: 转载请注明出处: http://blog.csdn.net/zhangyang0402/archive/2010/07/18/5744475.aspx 一、基本系统数据类型-time_t 在unix/linux系统中,时间的表示方法是以1970年1月1日00:00:00所经过的秒数,使用基本系统数据 阅读全文
posted @ 2015-06-05 14:27 SandKing 阅读(24) 评论(0) 推荐(0)
摘要: Reference: http://net.pku.edu.cn/~yhf/linux_c/function/04.html asctime(将时间和日期以字符串格式表示) 相关函数 time,ctime,gmtime,localtime 表头文件 #include<time.h> 定义函数 cha 阅读全文
posted @ 2015-06-05 14:22 SandKing 阅读(8) 评论(0) 推荐(0)
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 38 下一页