摘要: 环境:win10+Qt5.7 可以运行,但是调试时弹窗 “调试器未设置” 解决:需要下载 Debugging Tools for Windows 。 1、先找到window10 sdk的链接:https://developer.microsoft.com/en-US/windows/download 阅读全文
posted @ 2016-10-09 09:55 知吾猪 阅读(8037) 评论(1) 推荐(3) 编辑
摘要: 接口:http://zh.cppreference.com/w/cpp/memory/shared_ptr 这个网站比较好,概念比较简洁 如何使用:http://www.cnblogs.com/TianFang/archive/2008/09/19/1294521.html boost::share 阅读全文
posted @ 2016-07-30 14:42 知吾猪 阅读(293) 评论(0) 推荐(0) 编辑
摘要: function 定义一个可调用实体 lamda相当于闭包,匿名函数,OC中的block 下面是简答使用的一个demo function <int(int, int)> myfunc;//入参是int,int,出参是int myfunc = [](int x,int y)->int{ return 阅读全文
posted @ 2016-07-29 23:23 知吾猪 阅读(1472) 评论(0) 推荐(0) 编辑
摘要: bind是绑定,我接触过的高级语言js、swift中也有类似的应用。一个函数把另一个函数作为参数。 下面是我的demo,运行完,就知道是怎么回事了。 运行结果如下: 可以看出 f_bind = bind(func,10,20, _2,_1); bind后面第一个参数是绑定的函数名,后面是func对应 阅读全文
posted @ 2016-07-29 22:48 知吾猪 阅读(366) 评论(0) 推荐(0) 编辑
摘要: 本人对OC比较熟练。map其实相当于OC的字典,键值对存储,快速索引,内部的存储比较复杂,无序(内部已经排序) mutablemap可以增加相同key值的键值对。 自写的demo如下: 其他常用的接口 begin() 返回指向map头部的迭代器 clear() 删除所有元素 count() 返回指定 阅读全文
posted @ 2016-07-28 17:06 知吾猪 阅读(390) 评论(0) 推荐(0) 编辑
摘要: 为什么在C++使用pthread_create()的时候,类成员函数做线程的处理函数必须要定义成static类型的? 将线程函数作为静态函数 解决方案: 将this指针作为参数传递给静态函数,这样可以通过该this指针访问所有的私有变量,通过this指针访问成员函数。 下面的demo是个人作品,已经 阅读全文
posted @ 2016-07-27 15:09 知吾猪 阅读(1658) 评论(0) 推荐(0) 编辑
摘要: 这段代码可以运行。使用非静态方法后,传入的this指针没有使用,非传入的this对象调用自己的成员函数。!!!! #include "stdafx.h"#include <stdio.h>#include <process.h>class TMyClass {int m_nCount;int m_n 阅读全文
posted @ 2016-07-27 13:53 知吾猪 阅读(2324) 评论(0) 推荐(0) 编辑
摘要: 参考接口:http://www.cnblogs.com/xFreedom/archive/2011/05/16/2048037.html 自己写的demo如下,已经编译验证 阅读全文
posted @ 2016-07-26 23:15 知吾猪 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 这个很全: http://www.cnblogs.com/BeyondAnyTime/archive/2012/06/08/2542315.html 在面向对象这块,主要作为类方法的前缀。 .h中 .m中 调用 阅读全文
posted @ 2016-07-26 00:55 知吾猪 阅读(1302) 评论(0) 推荐(0) 编辑
摘要: 关于STL的介绍 http://www.cnblogs.com/biyeymyhjob/archive/2012/07/22/2603525.html 关于vector的资料不少,但是没看到demo,自己摸索写了一个,相关的概念和接口参照下面的帖子。 http://blog.sina.com.cn/ 阅读全文
posted @ 2016-07-25 23:51 知吾猪 阅读(283) 评论(0) 推荐(0) 编辑