随笔分类 - 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
阅读全文
摘要: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
阅读全文
摘要:1.swap整数很容易, 但是swap 大型的数据用临时变量的方法就会耗费很大。 function std::move exists that converts any lvalue (or rvalue) into anrvalue. Note that the name is misleadin
阅读全文
摘要:在IntCell.h 开头的#inndef IntCell_H #define IntCell_H #endif 是为了防止在编译的时候这个class被编译二次;因为在一个大型的项目中, class(A) 可以被文件B调用, 被文件C调用; 但是编译的时候我们希望 一个文件只被编译一次, 所以在.h
阅读全文
摘要: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; //
阅读全文
摘要:Understanding Rvalue and Lvalue C++ 11 instroduced rvalue reference. Lvalue- an object that occupies some identifiable location in memory. Rvalue- any
阅读全文
摘要:class Intcell { public: Intcell () {storeValue = 0;} // Int (int initialValue) {storeValue = initialValue;} private: int storeValue ; } Constructor: 分
阅读全文
浙公网安备 33010602011771号