上一页 1 ··· 91 92 93 94 95 96 97 98 99 ··· 133 下一页
摘要: 系统1:ThinkPad T570、Windows10、QT5.12.2(Qt Creater 4.8.2)一、动态库.dll的创建和调用1.在qtcreater中按如下步骤创建动态库,动态库名为mydll: 选择Library项目,C++库选择共享库:选择qt自带的kit:在工程中自动生成的myd 阅读全文
posted @ 2021-01-27 12:57 MaxBruce 阅读(3811) 评论(0) 推荐(0)
摘要: 什么是库文件? 库文件是事先编译好的方法的合集。比如:我们提前写好一些数据公式的实现,将其打包成库文件,以后使用只需要库文件就可以,不需要重新编写。 Linux系统中: 1.静态库的扩展名为.a;2.动态库的扩展名为.so; 源代码到可执行程序的转换时需要经历如下图所示的过程: 1.编译是指把用高级 阅读全文
posted @ 2021-01-27 10:24 MaxBruce 阅读(182) 评论(0) 推荐(0)
摘要: Semaphore是System.Threading下的类,限制可同时访问某一资源或资源池的线程数。 常用构造方法 https://msdn.microsoft.com/zh-cn/library/e1hct27h(v=vs.110).aspx public Semaphore( int initi 阅读全文
posted @ 2021-01-26 23:27 MaxBruce 阅读(277) 评论(0) 推荐(0)
摘要: 虽然以前我很怕git冲突,包括以前的版本控制器SVN上的冲突,但是昨天我决定好好的面对它,不去怕它,下面是我的解决过程。。。 话说一天的早上,我和同事(称为A)都同步了网络上的代码,然而A在中途提交了一次,并且合并到主分支master上了,更巧的是提交的那个文件是我现在也修改了的,然后等我晚上提交r 阅读全文
posted @ 2021-01-24 23:42 MaxBruce 阅读(393) 评论(0) 推荐(0)
摘要: 强制类型转换 1. static_cast 2. dynamic_cast 3. const_cast 4. reinterpret_cast 5. 为什么要需要四种类型转换? 1. static_cast 实现C++种内置基本数据类型之间的相互转换,不能用于两个不相关类型进行转换。 例如:将整形数 阅读全文
posted @ 2021-01-24 22:17 MaxBruce 阅读(641) 评论(0) 推荐(0)
摘要: 1.编写一个程序判断一个变量是不是指针? 拾遗-C++中仍然支持C语言中的可变参数函数-C++编译器的匹配调用优先级1.重载函数2.函数模板3.变参函数 #include <iostream> #include <string> using namespace std; class Test { p 阅读全文
posted @ 2021-01-24 21:33 MaxBruce 阅读(177) 评论(0) 推荐(0)
摘要: 类型识别 C++中如何得到动态类型? #include <iostream> #include <string> using namespace std; class Base { public: virtual string type() { return "Base"; } }; class D 阅读全文
posted @ 2021-01-24 21:32 MaxBruce 阅读(89) 评论(0) 推荐(0)
摘要: C++中的异常处理(下) array.h #ifndef _ARRAY_H_ #define _ARRAY_H_ #include <stdexcept> using namespace std; template < typename T, int N > class Array { T m_ar 阅读全文
posted @ 2021-01-24 21:10 MaxBruce 阅读(97) 评论(0) 推荐(0)
摘要: C++中的异常处理(中) 为什么要在catch中重新抛出异常? #include <iostream> #include <string> using namespace std; void Demo() { try { try { throw 'c'; } catch(int i) { cout 阅读全文
posted @ 2021-01-24 21:09 MaxBruce 阅读(102) 评论(0) 推荐(0)
摘要: C++内置了异常处理的语法元素try... catch ...-try语句处理正常代码逻辑-catch语句处理异常情况-try语句中的异常由对应的catch语句处理 try { double r = divide(1,0); } catch(...) { cout << "Divided by ze 阅读全文
posted @ 2021-01-24 21:07 MaxBruce 阅读(92) 评论(0) 推荐(0)
上一页 1 ··· 91 92 93 94 95 96 97 98 99 ··· 133 下一页