上一页 1 ··· 45 46 47 48 49 50 51 52 53 ··· 121 下一页
摘要: #include #include /**************************************** * 函数指针结构体 ***************************************/ typedef struct _OP { float (*p_add)(float, float); float (*p_sub)(float, floa... 阅读全文
posted @ 2019-07-21 19:04 wdliming 阅读(493) 评论(0) 推荐(0)
摘要: https://segmentfault.com/a/1190000008293902?utm_source=tag-newest https://www.cnblogs.com/tinaluo/p/8327880.html https://zhuanlan.zhihu.com/p/28300026 阅读全文
posted @ 2019-07-21 17:41 wdliming 阅读(3499) 评论(0) 推荐(0)
摘要: https://www.cnblogs.com/ioleon13/archive/2010/03/02/1676621.html 实际工作中,对于回调函数一直是我不愿意去触碰的东西,一来由于被很多人搞得神秘兮兮的以为是很高深难懂的技术,二来在一般情况下通过互相包含类指针也能够解决问题,所以一直就不想 阅读全文
posted @ 2019-07-21 16:49 wdliming 阅读(867) 评论(0) 推荐(1)
摘要: https://blog.csdn.net/hellozex/article/details/81742348 1、基础知识 所谓回调,就是模块A要通过模块B的某个函数b()完成一定的功能,但是函数b()自己无法实现全部功能,需要反过头来调用模块A中的某个函数a()来完成,这个a()就是回调函数。如 阅读全文
posted @ 2019-07-21 16:44 wdliming 阅读(438) 评论(0) 推荐(0)
摘要: 下面的函数返回elems的地址。可以返回静态对象的地址 通过去读取vector的返回值可以实现减少计算工作量的方法。cout << elem[0][in] <<" ";这个用法一定要注意,试了很就才发现。elem是一个向量指针,这个指针指向某一个向量的,因此类似于c语言中一个指针指向二位数组。 阅读全文
posted @ 2019-07-21 15:52 wdliming 阅读(768) 评论(0) 推荐(0)
摘要: #include #include using namespace std; vector fun1(int num) { vector values; for (int j = 0; j myvector; int i; cout > i; myvector = fun1(i); cout << endl; for (int m... 阅读全文
posted @ 2019-07-21 15:41 wdliming 阅读(2314) 评论(0) 推荐(1)
摘要: 1.标准库vector类型 vector 是同一种类型的对象的集合,每个对象都有一个对应的整数索引值。标准库将负责管理与存储元素相关的内存。我们把 vector 称为容器,是因为它可以包含其他对象。一个容器中的所有对象都必须是同一种类型的。 用 vector之前,必须包含相应的头文件。 #include 1 using std::vector; vector 是一个类模板(class t... 阅读全文
posted @ 2019-07-21 15:38 wdliming 阅读(10821) 评论(0) 推荐(0)
摘要: #include #include using namespace std; vector *MyFind() { vector *a=new vector; a->push_back(123); a->push_back(23); return a; } void Find(vector &vect) { vect.push_back(1); vect.push_bac... 阅读全文
posted @ 2019-07-21 15:37 wdliming 阅读(1666) 评论(0) 推荐(0)
摘要: #include #include using namespace std; //定义一个计算数字的函数,返回计算后的vector numbers bool computeNumber(int num, vector&numbers) { for (int i = 0; i numbers; computeNumber(10, numbers);//调用函数,调用... 阅读全文
posted @ 2019-07-21 15:35 wdliming 阅读(1986) 评论(0) 推荐(0)
摘要: void swap( int val1, int val2, ofstream &ofil ) { ofil << "swap( " << val1 << ", " << val2 << " )\n"; int temp = val1; val1 = val2; val2 = temp; ofil << "after swap(): va... 阅读全文
posted @ 2019-07-21 14:25 wdliming 阅读(347) 评论(0) 推荐(0)
上一页 1 ··· 45 46 47 48 49 50 51 52 53 ··· 121 下一页