过去写的随笔
杂项笔记
Varible
这个作者很懒,什么都没留下…
展开
-
C++自定义头文件
C++头文件格式:#include <[path]head[.h]> //系统头文件,“head”可带“.h”后缀(你看目前情况),按情况加路径。#include "[drive:][path]head.h" //自定义头文件,一定要有后缀,按情况加路径。举例:(判断越界的数组)arr.h#include <iostream>using namespace s...原创 2020-02-14 17:52:48 · 2281 阅读 · 0 评论 -
C++输入密码回显星号
C++输入密码回显星号password.cpp//本代码不支持除退格外其它特殊按键!!! #include <iostream>#include <string>#include "password.h"using namespace std;string pwd = "\0";int main(int argc,char *argv[]) { pwd =...原创 2020-02-25 12:14:36 · 2084 阅读 · 0 评论 -
C++用<vector>模拟栈
C++用<vector>模拟栈#include <cstdio>#include <vector>using namespace std;vector<int> vec;int main(int argc,char *argv[]) { for (int i = 0;i <= 9;i ++) vec.push_back(i);...原创 2020-02-16 17:50:35 · 597 阅读 · 0 评论 -
C++用类模板写一个栈
C++用类模板写一个栈#include <bits/stdc++.h>using namespace std;template <class Tclass>class Tstack { public: void push(Tclass const &elem); Tclass pop(); Tstack(); private: Tclas...原创 2020-02-13 18:34:05 · 1149 阅读 · 0 评论 -
C++:提供键盘鼠标控制头文件
keyboard.h#include <windows.h>#include <cstdarg>using namespace std;class keyboard { public: void click(int key) { keybd_event(key,0,0,0); keybd_event(key,0,KEYEVENTF_KEYUP,0)...原创 2020-02-18 11:23:02 · 1386 阅读 · 0 评论 -
用C++做一个特小型恶意程序
用C++做一个特小型恶意程序#include <windows.h>#include <ctime>#include <cstdlib>using namespace std;int x = 0;int main(int argc,char *argv[]) { srand(time(0)); for (;;) { x = rand() % ...原创 2020-02-17 15:55:16 · 1902 阅读 · 7 评论 -
C/C++ 给main()传递参数
C/C++ 给main()传递参数我把C和C++的源代码都会写下,但各位要点赞!Dev-C++也可以写C先不急,这不是个方法,这是个知识点。在我掌握这个知识点前,我与大家一样,main这么写:Cint main(void) { return 0;}C++using namespace std;int main(void) { return 0;}是吧?(void...原创 2020-02-19 19:51:10 · 7089 阅读 · 3 评论 -
C++MessageBoxA和MessageBoxW
MessageBox()和MessageBoxA()的区别其实是没区别的。看看C++定义MessageBox是怎么定义的:(winuser.h)#define MessageBox __MINGW_NAME_AW(MessageBox)预处理器。再看看__MINGW_NAME_AW()是怎么弄的:(mingw_unicode.h)#define __MINGW_NAME_AW(fun...原创 2020-02-16 16:51:15 · 2440 阅读 · 1 评论 -
C++魔性字符刷屏
C++魔性字符刷屏char.cpp#include <iostream>#include <cstdlib>#include <ctime>#include <windows.h>#include <cmath>using namespace std;char c = '\0';int main(int argc,cha...原创 2020-02-28 10:54:15 · 1236 阅读 · 0 评论 -
C++ asm关键字
C++ asm关键字大家可能听说过C++有一个asm,这就是在C++内部嵌入 汇编(Assembler) 指令。汇编是一门 独立的 编程语言,在C++中,可以用asm来嵌入汇编 指令 ,但并不是说要把汇编框架都写下来。格式如下:asm ("Assembler");//Assenmbler指汇编指令/* *你会看到“asm”变成了关键字样式的字体 *汇编指令由字符串方式填在括号里 *...原创 2020-02-11 20:50:08 · 8195 阅读 · 1 评论 -
C++制作一个能判断越界的数组
C++制作一个能判断越界的数组#include <bits/stdc++.h>using namespace std;template <class arr_t>class arr { public: explicit arr(int n) { if (n <= 0) throw "arr::arr():Underflow!"; if (n ...原创 2020-02-14 11:42:59 · 290 阅读 · 0 评论 -
一个VisualBasicScript代码让你搞懂MsgBox与InputBox!
先声明一下:wscript.echo(“string”) 子程序,输出字符串;MsgBox(“Text.”,style_of_button,“Caption”) 子程序,消息框;InputBox(“Text.”,“Caption”,“The string which is in the form.”) 函数,输入框。实在不懂,就运行一下再对照一下。(请务必在cscript.exe内(在命...原创 2020-03-07 09:45:40 · 490 阅读 · 0 评论