
C++
suianyang
这个作者很懒,什么都没留下…
展开
-
网站
http://www.cplusplus.com/原创 2015-01-19 16:09:22 · 385 阅读 · 0 评论 -
Variable initialization in the switch statement
#include <iostream>int main() { std::cout << "Please input a integer: "; int t = 0; std::cin >> t; switch (t) { case 0: int a; a = 0; //int a = 0; std::cout << "You intput原创 2015-11-08 15:55:10 · 386 阅读 · 0 评论 -
Order of Evaluation
C++中的四个能够保证求值顺序的运算符&&||?:,对于没有指定求值顺序的运算符,在一个表达式里既改变又使用一个对象是一个错误。 int i = 0; cout << i << ” ” << ++i << endl; // undefinedA rule of thumb如果你改变了一个操作数的值,不要在这个表达式的任何其他地方使用这个操作数下面的代码片段是错误的int a[3] =原创 2015-08-24 09:30:50 · 468 阅读 · 0 评论 -
C/C++ 中获取时间差
#include #include using namespace std ; int main(){ clock_t s, e; s = clock() ; for(int i=100000000; i>0; --i) ; e = clock() ; cout << e-s << " clock ticks elapsed!" << endl ;原创 2015-03-02 09:46:27 · 670 阅读 · 0 评论 -
<Essential C++> Learning
1. Chapter 1: Basic C++ Programming1.1 Pass by value and pass by reference#include #include using namespace std; void display_ref(const vector &); void display_ptr(const vector *); in原创 2015-02-12 19:53:05 · 903 阅读 · 0 评论 -
Member Initialization List in C++
#include using namespace std ; class bar { public: bar() { cout << "bar constructor called!\n" ; } bar(const bar &b) { cout << "bar copy constructor called!\n" ; }原创 2015-02-12 21:09:41 · 566 阅读 · 0 评论 -
暂时刷完leetcode的一点小体会
http://www.cnblogs.com/moondark/p/3402936.html 两年前,在实习生笔试的时候,笔试百度,对试卷上很多问题感到不知所云,毫无悬念的挂了读研两年,今年代笔百度,发现算法题都见过,或者有思路,但一时之间居然都想不到很好的解法,而且很少手写思路,手写代码,有点仓皇失措;概念题却是很难答好,大多我都知道,但却难以描述清楚;最后一题大转载 2015-01-26 14:22:38 · 453 阅读 · 0 评论 -
On custom hasher in STL
http://stackoverflow.com/a/17017281转载 2016-08-12 14:03:34 · 267 阅读 · 0 评论