上一页 1 ··· 5 6 7 8 9 10 11 下一页
摘要: class A { int _a; public: A(int a): _a(a){} friend int f1(A &);//1 friend int f2(const A &);//2 friend int f3(A);//3 friend int f4(const A);//4 }; /*. 阅读全文
posted @ 2018-08-19 19:47 zengzhaocheng 阅读(513) 评论(0) 推荐(0) 编辑
摘要: 空悬指针 简单地说,空悬指针是对象的指针的生存周期比对象更长所导致的,也就是说,对象销毁、删除了,不存在了,指针仍然存在,这时这个指针就成了空悬指针。 当对象被析构、删除时,如果指向它的指针没有被同时修改,那么指针仍然会指向那块内存(但是那块内存已经没有东西了)。系统此时可能会重新分配这块已经fre 阅读全文
posted @ 2018-08-19 18:54 zengzhaocheng 阅读(910) 评论(0) 推荐(0) 编辑
摘要: C++ double型不能实施%操作符,作为除数被除数都不可以,但可以用fmod函数,则作为除数被除数都可以,即 fmod = numer - tquot * denom //tquot 是除法结果向“下”取整(向0的方向)的结果,denom是除数 一个例子是 /* fmod example */ 阅读全文
posted @ 2018-08-17 16:40 zengzhaocheng 阅读(8491) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> using namespace std; int main(){ int b[4]={1,2,3,4}; const int* a = b; int * c = a;//error: invalid conversion from 'const int*' to 阅读全文
posted @ 2018-08-16 11:10 zengzhaocheng 阅读(1112) 评论(0) 推荐(0) 编辑
摘要: 1.位运算 位运算可以有效改善乘除法比较慢的问题,同时,用除法可以避免double型变量,因为一个整数除以某个数就可以变成小数,当然,这里的前提是要是2的整数次幂才好做除法,同时要能忍受一定的精度损失。 阅读全文
posted @ 2018-08-15 21:10 zengzhaocheng 阅读(205) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> using namespace std; int *test_array(int *a){ int length = sizeof(a)/sizeof(a[0]); int *b = new int [length]; for (int i = 0; i < l 阅读全文
posted @ 2018-08-15 16:41 zengzhaocheng 阅读(618) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> using namespace std; void printhaha(){ static char haha[] = "haha"; cout<<"hello "<<haha<<endl; haha[0] = haha[0]+1; } void printhe 阅读全文
posted @ 2018-08-14 15:05 zengzhaocheng 阅读(2677) 评论(0) 推荐(0) 编辑
摘要: int main(){ char []a = "haha";//error return 0; } error: decomposition declaration cannot be declared with type 'char' error: empty decomposition decl 阅读全文
posted @ 2018-08-14 14:56 zengzhaocheng 阅读(857) 评论(0) 推荐(0) 编辑
摘要: 基本上1D Measure都是建立一个ROI(region of interest,感兴趣区域),然后在感兴趣区域提取出边界的测量。常见的ROI有矩形ROI和圆环ROI。 下图为一个矩形ROI,中间的Profile Line为横截线,Center是行和列的坐标,Phi指定了它的倾斜角度,Length 阅读全文
posted @ 2018-08-14 14:46 zengzhaocheng 阅读(3048) 评论(0) 推荐(0) 编辑
摘要: 在计算机程序中,句柄是一个对资源的抽象引用。句柄被使用时往往是应用程序引用的内存块或者对象被其他系统掌控着,例如被其他数据库或者操作系统控制。一个资源的句柄可以是一个不透明的标识符--即程序员可以使用但不知道其具体是如何实现的--它通常是一个整数(通常是一个表,或数组,管理着某一类的资源),或者可以 阅读全文
posted @ 2018-08-10 14:26 zengzhaocheng 阅读(161) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 下一页