![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
Ez_coder
How to program?
展开
-
C++ 随机数小程序
C++随机数小程序#include <iostream>#include <time.h>#include <windows.h>#include <tchar.h>using namespace std;//打印界面void love() { float x, y; for (y = 1.5f; y > -1.5f; y -= 0.1f) { for (x = -1.5f; x < 1.5f; x += 0.05f)原创 2021-09-28 19:09:51 · 196 阅读 · 0 评论 -
C++虚函数调用方式
基础:直接调用在反汇编里 Call的是一个地址 硬编码为E8…。间接调用在反汇编里是Call [] 硬编码一般为FF …什么是虚函数?虚函数就是函数面前加个virtual观察虚函数的调用方式->通过创建对象的方式观察虚函数演示代码#include <iostream>using namespace std;class Base {public: void Function_1() { cout << "函数1" << endl; }原创 2021-09-20 11:02:46 · 2361 阅读 · 0 评论 -
C++防止程序多开
首先我们要知道程序天生就可以多开的且每次运行都是拥有自己独立的内存空间。但我们可以发现类似游戏这些程序是不能多开的,他们是怎么做的呢?这里教大家一个最简单的方法。HANDLE g_hEvent; //定义一个句柄int main() { g_hEvent = CreateEventW(NULL, 0, 0, LPCWSTR("Hi")); SetEvent(g_hEvent); if (g_hEvent) { if (ERROR_ALREADY_EXISTS == GetLa原创 2021-09-11 20:41:44 · 1466 阅读 · 0 评论 -
C++ 简单模拟谷歌数字1000以内数字翻译
谷歌翻译程序翻译代码:#include <iostream>#include <string>using namespace std;//对应字符string NUMBER[] = { "","one ","two ","three ","four ","five ","six ","seven ","eight ","nine ","ten ","eleven ","twelve ","thirteen ","fourteen " , "fifteen "原创 2021-07-26 09:42:07 · 314 阅读 · 0 评论