C/C++
夜伏击
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
C++ 指针和引用的本质 (一)
先写个最简单的测试代码: test_ref.cpp: #include int main(void) { int a = 10; int &ra = a; ra =20; int b = 100; int *pb = &b; *pb = 200; return 0; } 上面定义了个引用 ra和指针 pb 将上面的代码进行编译:原创 2016-08-27 23:01:26 · 1025 阅读 · 0 评论 -
C++宏,普通函数,内联函数的运行速度以及三者的差异
下面论证一下:c/c++中 运行速度对比,宏>内联函数>普通函数 首先简单的代码验证下: #include "stdafx.h" #include #include #define _SUM(x,y) x+y using std::cout; using std::endl; using boost::timer; const int MAX原创 2016-08-11 23:46:11 · 3207 阅读 · 0 评论 -
C/C++宏,枚举,常量
在C/C++中,宏,枚举,常量都可以表示“常量”,即不变的值。究竟三者有什么区别,本质是什么。下面来证实一下: 1先上个最简单程序,宏的 test_macro.c #include #define ONE 1 #define TWO 2 #define THREE 3 int main(void) { printf("%d\n",ONE); printf("%d\n",TWO原创 2016-09-04 19:29:53 · 655 阅读 · 0 评论
分享