摘要: 复制构造函数与复制赋值的区别如下: class Name { const char* s; //... }; class Table { Name* p; size_t sz; public: //... Table(const Table&); //复制构造函数 Table& operator=( 阅读全文
posted @ 2018-09-22 20:58 东宫得臣 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 关联数组是用户定义类型中最常见的也是最有用的一类。关联数组也常被成为映射(map),有时被 成为字典(dictionary),其中保存的是值的对偶。给定了一个称为关键码的值,我们就能访问另一个 称为映射值的值。可以将关联数组想象为一个下标不必是整数的数组: template<class K, cla 阅读全文
posted @ 2018-09-22 17:57 东宫得臣 阅读(1836) 评论(0) 推荐(0) 编辑
摘要: #include <sys/stat.h> int stat(const char *restrict pathname, struct stat *restrict buf); struct stat { mode_t st_mode; /*file type & mode(permissions 阅读全文
posted @ 2018-09-22 10:15 东宫得臣 阅读(3769) 评论(1) 推荐(1) 编辑