摘要: Lambda Expressions Derived from Lisp Previously for_each needs a function Will use new C++11 idea - write an unnamed function in place - a lambda expr 阅读全文
posted @ 2019-01-23 21:32 王老吉味巧克力 阅读(96) 评论(0) 推荐(0) 编辑
摘要: Standard Template Library Standard template library accepted in July 1994 into C++ ANSI Standard STL library provides containers,iterators and algorit 阅读全文
posted @ 2019-01-23 20:16 王老吉味巧克力 阅读(138) 评论(0) 推荐(0) 编辑
摘要: reverse() A canonical algorithm using this iterator is the STL reverse() algorithm: This algorithm reverses the elements in the specified iterator ran 阅读全文
posted @ 2019-01-23 11:58 王老吉味巧克力 阅读(126) 评论(0) 推荐(0) 编辑
摘要: Wish to compute the probability in 5 card stud of making a straight flush Will create abstract data types to have card Will use vector and shuffle fro 阅读全文
posted @ 2019-01-22 22:16 王老吉味巧克力 阅读(154) 评论(0) 推荐(0) 编辑
摘要: the enum of C++ 11 have some new features <regex> - regular expression <thread> - threading <unordered_map> - hash based map <array> - fixed size arra 阅读全文
posted @ 2019-01-22 19:03 王老吉味巧克力 阅读(82) 评论(0) 推荐(0) 编辑
摘要: 昨天调试了好久这三行代码,每次读出来发现只能传输第一个数字,很是苦恼,以为这样无法实现file到vector的传输。其实不然。 以上是我一开始的代码,这里我忽略了一个问题,我把start赋值给了it,所以我遍历的其实是文件流data_file里的元素,但是我将文件流赋给了vector,这对文件流里的 阅读全文
posted @ 2019-01-10 22:03 王老吉味巧克力 阅读(533) 评论(0) 推荐(0) 编辑
摘要: C++ For C Programmers 4.5 Overloading and Function Selection point(double u):x(u),y(0.0) {}是一种隐式类型转换,如果我把u=5赋值给一个point,则会把u=5转换成 point u = (5.0, 0.0). 阅读全文
posted @ 2019-01-04 21:31 王老吉味巧克力 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 正在Coursera上学习C++ For C Programmers,学到了最小生成树这里,就以自己的思路尝试实现,小白写得比较粗糙。 普里姆算法有点贪婪算法的感觉,先找到一个开始点,然后将它所能到达的的点放入一个priority_queue记为Q,从中选取距离最短的点与开始点连接,一直持续下去直到 阅读全文
posted @ 2019-01-03 21:18 王老吉味巧克力 阅读(586) 评论(0) 推荐(0) 编辑