摘要: 1 #include <cassert> 2 #include <iostream> 3 4 using namespace std; 5 6 #define N 9 7 8 void print(const int* arr, int n); 9 10 void insert_sort (int* arr, int n, int (*cmp)(int, int)); 11 void bin_insert_sort (int* arr, int n, int (*cmp)(int, int)); 12 void shell_sort (int* arr, int n.. 阅读全文
posted @ 2013-05-03 14:21 Astone 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 1 /** 2 const 总是向右结合 3 eg, 4 当和 * 结合的时候表明: 变量的值作为一个地址, 而这个地址所指向的内容是常量. 5 当和变量名结合的时候, 表明这个变量本身的值是一个常量. (如果这个变量是一个指针, 那么变量本身的值是一个地址, 这个地址所指向的内容不一定是常量) 6 (const 和类型结合没有意义) 7 */ 8 #include <iostream> 9 10 using namespace std;11 12 int main(void)13 {14 int i = 0;15 const* int a = &i; // warn... 阅读全文
posted @ 2013-05-03 12:34 Astone 阅读(283) 评论(0) 推荐(0) 编辑