随笔分类 -  C++

1 2 3 4 5 ··· 7 下一页
摘要:源码地址: https://github.com/rofl0r/microsocks 下载之后Make编译 阅读全文
posted @ 2021-01-10 13:57 瓜蛋 阅读(1367) 评论(0) 推荐(0) 编辑
摘要:两个线程可以同时读。但是有写的时候,是全部锁定。 阅读全文
posted @ 2020-12-14 04:35 瓜蛋 阅读(218) 评论(0) 推荐(0) 编辑
摘要:二话不说,直接举个简单的例子吧。假如要从http://192.168.15.22:8888 取出192.168.15.22,用以下代码搞定std::regex reg("(\\d+\\.\\d+\\.\\d+\\.\\d+):\\d{2,5}"); std::smatch match; const std::string& proxy_ip = "http://192.168.15.2... 阅读全文
posted @ 2020-09-11 23:24 瓜蛋 阅读(2072) 评论(0) 推荐(0) 编辑
摘要:如果使用qmlRegisterType注册类型时,报这个错误,八成是写的类,有一个构造函数,并且这个构造函数有一个参数,而且这个参数没有默认值。要角色这个问题,就把构造函数弄一个默认值吧class MySortFilterProxyModel : public QSortFilterProxyMod 阅读全文
posted @ 2020-08-04 19:27 瓜蛋 阅读(641) 评论(0) 推荐(0) 编辑
摘要:程序通过调用GetSystemInfo得到CPU内核数目的目的,起初想在进程内Hook GetSystemInfo 这个API来达到效果,但是这样HOOK还得向进程注入一个DLL,比较麻烦。后来得知GetSystemInfo 这个函数内部调用内核NtQuerySystemInformation来达到 阅读全文
posted @ 2020-08-01 19:11 瓜蛋 阅读(1606) 评论(0) 推荐(0) 编辑
摘要:在win10 64位使用VirtualBox使用双机内核调试。当打开VirtualBox时提示: VirtualKD cannot patch VirtualBox on-the-fly. Please register the VirtualKD device for VirtualBox by 阅读全文
posted @ 2020-07-30 09:08 瓜蛋 阅读(397) 评论(0) 推荐(0) 编辑
摘要:在上面代码中std::unique_lock可以传进std::lock,因为std::unique_lock有unique_lock提借lock、try_lock、unlock成员函数。std::unique_lock有一个owner_lock函数来判断是否现在已经被锁定。你可以会说使用std::l 阅读全文
posted @ 2020-02-11 11:06 瓜蛋 阅读(447) 评论(0) 推荐(0) 编辑
摘要:vs2017 ->工具->选项->NuGet 包管理器->清除所有NuGet缓存 阅读全文
posted @ 2019-03-09 22:37 瓜蛋 阅读(955) 评论(0) 推荐(0) 编辑
摘要:https://docs.microsoft.com/en-us/cpp/cpp/string-and-character-literals-cpp?view=vs-2017 C++ supports various string and character types, and provides 阅读全文
posted @ 2019-02-26 22:57 瓜蛋 阅读(1186) 评论(1) 推荐(0) 编辑
摘要:下面这行代码 当在Debug状态时,代码没总理。当切换到Release状态时这整句代码是不执行的 说明assert内部的表达式 必须为判断,而不能为一个动作。否则这个动作在Release的版本中是无法执行的。 阅读全文
posted @ 2019-01-28 21:47 瓜蛋 阅读(606) 评论(0) 推荐(0) 编辑
摘要:假如有这样一个指针 int * idx16 那么要想在调试里面显示为数组并且要显示的数组元素个数为24的话,则要写成idx16,24 如下图 阅读全文
posted @ 2018-12-08 00:09 瓜蛋 阅读(1267) 评论(0) 推荐(0) 编辑
摘要:SQL Server 2005 introduced the APPLY operator, which is like a join clause and it allows joining between two table expressions i.e. joining a left/out 阅读全文
posted @ 2018-12-01 09:43 瓜蛋 阅读(298) 评论(0) 推荐(0) 编辑
摘要:在IsDebuggerPresent下断,步入得到如下代码: 在fs:[18]下断点得出 其中fs:[18] =7EFDD000 eax+30就是这里 再来看看7EFDE000里的值 ds:[eax+2] = 1 .所以是调试状态 那么c++一行代码直接可以修改这个值,使IsDebuggerPres 阅读全文
posted @ 2018-10-08 21:27 瓜蛋 阅读(959) 评论(0) 推荐(0) 编辑
摘要:在链接 输入里加入:ucrtd.lib 阅读全文
posted @ 2018-09-28 22:04 瓜蛋 阅读(1820) 评论(0) 推荐(0) 编辑
摘要:用处1, 用在模板定义里, 标明其后的模板参数是类型参数。 例如: 其实,这里最常用的是使用关键字class,而且二者功能完全相同,这里的class和定义类时的class完全是两回事,C++当时就是为了减少关键字,才使用了class。但最终却不得不引入了typename,究竟是 什么原因呢?请看第二 阅读全文
posted @ 2018-09-23 17:26 瓜蛋 阅读(13333) 评论(2) 推荐(4) 编辑
摘要:std::lower_bound default (1) template <class ForwardIterator, class T> ForwardIterator lower_bound (ForwardIterator first, ForwardIterator last, const 阅读全文
posted @ 2018-07-30 23:27 瓜蛋 阅读(2889) 评论(0) 推荐(0) 编辑
摘要:这个Offset官方解释是:Offset (in bytes) from the start of the index buffer to the first index to use. 翻译成中文就是:是从索引索引开始的第Offset字节算作第一个索引来使用 这个参数和DrawIndex的Star 阅读全文
posted @ 2018-07-06 11:00 瓜蛋 阅读(367) 评论(0) 推荐(0) 编辑
摘要:答案就是链接:legacy_stdio_definitions.lib 这个lib即可 阅读全文
posted @ 2018-06-21 22:32 瓜蛋 阅读(2347) 评论(0) 推荐(1) 编辑
摘要:Data Type ILP32 ILP64 LP64 LLP64char 8 8 8 8short 16 16 16 16int 32 64 32 32long 32 64 64 32long long 64 64 64 64pointer 32 64 64 64在网上查资料,还看到一个LP32(l 阅读全文
posted @ 2018-05-22 19:52 瓜蛋 阅读(748) 评论(0) 推荐(0) 编辑
摘要:std::vector<std::wstring> list = Client.xxxx(); 千万不要写成 auto list = Client.xxxx(); 阅读全文
posted @ 2018-05-20 18:29 瓜蛋 阅读(460) 评论(0) 推荐(0) 编辑

1 2 3 4 5 ··· 7 下一页