随笔分类 -  C ++

摘要:Tail Recursion Why space complexity is less in case of loop ? Before explaining this I am assuming that you are familiar with the knowledge that’s how 阅读全文
posted @ 2020-11-12 08:04 John_K 阅读(121) 评论(0) 推荐(0)
摘要:An operator is a symbol that tells the complier to perform specifc mathematical or logical manipulations. C++ allows u to specify more than one defini 阅读全文
posted @ 2020-06-14 08:47 John_K 阅读(183) 评论(0) 推荐(0)
摘要:1.swap整数很容易, 但是swap 大型的数据用临时变量的方法就会耗费很大。 function std::move exists that converts any lvalue (or rvalue) into anrvalue. Note that the name is misleadin 阅读全文
posted @ 2020-06-14 04:02 John_K 阅读(624) 评论(0) 推荐(0)
摘要:在IntCell.h 开头的#inndef IntCell_H #define IntCell_H #endif 是为了防止在编译的时候这个class被编译二次;因为在一个大型的项目中, class(A) 可以被文件B调用, 被文件C调用; 但是编译的时候我们希望 一个文件只被编译一次, 所以在.h 阅读全文
posted @ 2020-06-14 03:52 John_K 阅读(128) 评论(0) 推荐(0)
摘要:明日更新 阅读全文
posted @ 2020-05-25 08:49 John_K 阅读(109) 评论(0) 推荐(0)
摘要:Part I: const variable const is a complie time constraint that an object can not be modified. const int i = 0; i = 9 ; // error const int *pi = &i; // 阅读全文
posted @ 2020-05-25 08:47 John_K 阅读(176) 评论(0) 推荐(0)
摘要:Understanding Rvalue and Lvalue C++ 11 instroduced rvalue reference. Lvalue- an object that occupies some identifiable location in memory. Rvalue- any 阅读全文
posted @ 2020-05-25 08:45 John_K 阅读(384) 评论(0) 推荐(0)
摘要:class Intcell { public: Intcell () {storeValue = 0;} // Int (int initialValue) {storeValue = initialValue;} private: int storeValue ; } Constructor: 分 阅读全文
posted @ 2020-05-17 02:37 John_K 阅读(185) 评论(0) 推荐(0)