随笔分类 - C++
摘要:int main(int argv, char* argc[]), argc[0] is always the program's name that you run switch() statement doesn't accept std::string. One way to solve th
阅读全文
摘要:1. Template functiontemplate // a template prefixT func(T a, T b, T c){ // return value is T type, 3 T-typed formal parameters return a + b + c;}We...
阅读全文
摘要:refer to this article 1 bool IsPrimeOptimizationThree(int number) 2 { 3 if(number<2) 4 return false; 5 if(number==2) 6 return ...
阅读全文
摘要:So you have a C++ template class, but you want to specifiy a member function for a particular type of data: 1 // A template class called Image: 2 tem...
阅读全文
摘要:BFS is faster to find shortest path from root to leaf node of a tree. But the tradeoff is to use more memory.the basic trategy is to maintain a list t...
阅读全文

浙公网安备 33010602011771号