摘要:
动态映射 安全类型向下映射 #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)

浙公网安备 33010602011771号