文档说明
记录CPP的一些基础用法
基础变量变量声明1234int 整型=0;int[] 数组={2,2,2};char 字符='a';String 字符串="我是字符串";
结构体结构体声明123456struct 结构体{string 字符串;int x;int y;}
类类声明123456789class Box{ public: // 公有成员 protected: // 受保护成员 private: // 私有成员};
函数回调函数
通过指针函数对函数进行调用
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091#include <cassert>#i ...
文档说明
用于记录CMake编译器的用法
CMake用法基础
模板
123cmake_minimum_required(VERSION 3.10) #版本project(MyProject) #项目名
可执行文件
1add_executable(可执行文件名 main.cpp)
多个可执行文件
12add_executable(可执行文件名1 my1.cpp) add_executable(可执行文件名2 my2.cpp)
生成静态文件
生成静态库
12set(MUL_SOURCES ./mul/mul.cpp) #设置CPP路径变量add_library(mul STATIC ${MUL_SOURCES}) #通过MUL_SOURCES路径STATIC属性添加为静态库
链接全局,将静态链接链接至所有程序
123include_directories(./) #添加头文件路径1.link_directories(路径) #添加静态库链接所在目录2.link_libraries(库名) #将静态库链接 ...
文档说明
此文档记录了C++普通数组实现增删改查的方法
声明123int const 数组最大长度=10; //声明数组最大长度int 数组数据=[N+1]; //声明数组,长度为11 同:int 数组数据[11];int 元素数量=0; //声明一个整形遍历,用来记录存储数组元素数量
插入数组的方法
创建一个带有一个参数的方法
判断数组数组元素数量是否等于最大数组元素,如果等于则返回跳出
如果元素数量小于最大元素数量,数组=等于参数,元素数量+1,
123456789void 插入元素(int 元素){ if (元素数量==数组最大长度) { cout<<"数组满了"<<endl; return; //跳出函数 } 数组数据[元素数量=元素数量+1]=元素; //数组数据[1]=元素}
通过以上方法可以通过for直接插入数组
1234for(int i=1;i< ...
安知鱼网站部署初始化HEXO
初始化
123hexo init <folder>cd <folder>npm install
生成本地网页
1hexo server
部署插件
1npm install hexo-deployer-git --save
部署
1hexo clean && hexo deploy
初始化安知鱼
安装
1git clone -b main https://github.com/anzhiyu-c/hexo-theme-anzhiyu.git themes/anzhiyu
安装渲染插件
1npm install hexo-renderer-pug hexo-renderer-stylus --save
应用主题
1234# Extensions## Plugins: https://hexo.io/plugins/## Themes: https://hexo.io/themes/theme: anzhiyu
配置文件123456789101112131415161718192021 ...
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Quick StartCreate a new post1$ hexo new "My New Post"
More info: Writing
Run server1$ hexo server
More info: Server
Generate static files1$ hexo generate
More info: Generating
Deploy to remote sites1$ hexo deploy
More info: Deployment








