随笔分类 - C++ BasicKnowledge
摘要:简述:排序算法,参见http://www.cplusplus.com/reference/algorithm/?kw=algorithm待解决问题:各种排序算法的实现/*template void sort (RandomAccessIterator first, RandomAccessItera...
阅读全文
摘要:简述:改变序列算法,参见http://www.cplusplus.com/reference/algorithm/?kw=algorithm待解决问题:iterator_traits、std::move/*template BidirectionalIterator partition (Bidir...
阅读全文
摘要:简述:ctime头文件中的4中与时间相关的数据类型头文件中定义了4种与时间有关的数据类型,如下:clock_tsize_ttime_tstruct tmclock_tClock type[时钟类型]Alias of a fundamental arithmetic type capable of r...
阅读全文
摘要:简述:printf、sprintf函数转载自http://www.cnblogs.com/adslg/archive/2008/08/22/1274164.html 部分进行了修改,参考http://www.cplusplus.com/reference/cstdio/printf/?kw=prin...
阅读全文
摘要:概述:不变序列算法,参见http://www.cplusplus.com/reference/algorithm//*std::for_eachtemplate Function for_each (InputIterator first, InputIterator last, Funct...
阅读全文
摘要:首先我们看一下函数指针。函数指针是指向函数的指针变量,在编译程序时,每一个函数都有一个入口地址,而指向这个函数的函数指针便指向这个地址。函数指针的作用主要有两个:用作调用函数和用作函数的参数。函数指针用作调用函数的实例如下:#include using namespace std;typedef v...
阅读全文
摘要:template class bitset;BitsetA bitset stores bits (elements with only two possible values: 0 or 1, true or false, ...).[bitset存储位(元素只能为两种可能的数值,即0或1,tr...
阅读全文
摘要:template , class Compare = less > class priority_queue;Priority queuePriority queues are a type of container adaptors, specifically designed such that...
阅读全文
摘要:参见http://www.cplusplus.com/reference/map/map/template , // map::key_compare class Alloc = allocator > // map::allocator_type > class map;Maps are asso...
阅读全文
摘要:参见http://www.cplusplus.com/reference/stack/stack/ template> class stack; LIFO stack Stacks are a type of container adaptor, specifically designed to o...
阅读全文
摘要:转载http://blog.csdn.net/thefutureisour/article/details/7751846容器适配器容器适配器其实就是一个接口转换装置,使得我们能用特定的方法去操作一些我们本来无法操作的东西。举一个例子,比如你的一个设备支持串口线,而你的电脑支持的是USB接口,这时候...
阅读全文
摘要:参见http://www.cplusplus.com/reference/deque/deque/deque是双向开口的连续性存储空间。虽说是连续性存储空间,但这种连续性只是表面上的,实际上它的内存是动态分配的,它在堆上分配了一块一块的动态储存区,每一块动态存储区本身是连续的,deque自身的机制把...
阅读全文
摘要:template > class list;ListLists are sequence containers that allow constant time insert and erase operations anywhere within the sequence, and iterat...
阅读全文
摘要:参见http://www.cplusplus.com/reference/set/multiset/template , // multiset::key_compare/value_compare class Alloc = allocator > // multiset::allocator_t...
阅读全文
摘要:参见http://www.cplusplus.com/reference/map/multimap/多重映射multimap和map映射很相似,但是multimap允许重复的关键字,这使得multimap在某些情况下会更有用,比如说在电话簿中同一个人可以有多个电话号码multimap中并没有像map...
阅读全文
摘要:参见http://www.cplusplus.com/reference/set/set/ /*template , // set::key_compare/value_compare class Alloc = allocator // set::allocator_type > class set; Se...
阅读全文
摘要:参见C++ Reference:http://www.cplusplus.com/reference/vector/vector/?kw=vector typedef basic_string string; String classStrings are objects that represent sequences of characters.[string类对象就是字符串序列]The ...
阅读全文
摘要:参考:http://www.jb51.net/article/53760.htm 通常来说,在C++中,命名空间(namespace)的目的是为了防止名字冲突。每个命名空间是一个作用域,在所有命名空间之外,还存在一个全局命名空间(global namespace),全局命名空间以隐式的方式声明,它并...
阅读全文
摘要:容器是包含其他对象的对象,标准C++库中提供了一系列的容器,这些容器可以分为两种类型,顺序容器和关联容器。顺序容器可提供对自身元素的顺序访问或者随机访问,标准C++库提供了3种顺序容器,即vector、list、deque;关联容器则是用关键字对关键元素进行访问,标准C++库提供了4种关联容器,即...
阅读全文
摘要:参考: http://blog.163.com/zhuandi_h/blog/static/180270288201291710222975/ http://www.cnblogs.com/gamesky/archive/2013/01/09/2852356.html C++标准库中的提供了比ANSI C的更高级的一些功能,即单纯性、类型安全和可扩展性。在本文中,我...
阅读全文

浙公网安备 33010602011771号