C++_字符串_动态数组_数组
标准库类型 stringstring 表示可变长字符序列。使用 string 必须包含头文件: 12#include <string>using std::string; 定义和初始化 string 对象1234string s1; // 默认初始化,s1 是空串string s2 = s1; // s2 是 s1 的副本string s3 = "hello"; // s3 是字符串字面值的副本string s4(5, 'c'); // s4 的内容是 "ccccc" 常见初始化方式 写法 含义 string s1; 默认初始化,空串 string s2(s1); s2 是 s1 的副本 string s2 = s1; 等价于 string s2(s1); string s3("value"); s3 是 "value" 的副本,不包含结尾 '\0' string s3 = "value...
C++_变量和基本类型
C++ 的基本内置类型分为两大类: 算术类型:用于表示数值和字符 空类型(void):不对应具体的值,常用于特殊场景,如函数无返回值、void* 指针等 算术类型算术类型分为: 整型:包括字符类型和布尔类型 浮点型 常见内置类型 类型 含义 最小尺寸 bool 布尔类型 未规定 char 字符 8 位 wchar_t 宽字符 至少 16 位 char16_t Unicode 字符 16 位 char32_t Unicode 字符 32 位 short 短整型 16 位 int 整型 16 位 long 长整型 32 位 long long 长长整型 64 位 float 单精度浮点数 6 位有效数字 double 双精度浮点数 10 位有效数字 long double 扩展精度浮点数 10 位有效数字 注意:表中的“最小尺寸”是语言标准规定的下限,实际大小依赖编译器和平台。 整型之间的大小关系C++ 保证: 1short <= int <= long <= long long 也就是说: ...
基于Hexo和云服务器的个人博客搭建
本地环境本地Hexo环境搭建1234567891011121314# 安装 Node.js(版本需≥14)# 官网下载:https://nodejs.org (选LTS版本)# 安装 git# 安装 Hexo npm install -g hexo-cli# 创建博客文件夹并初始化hexo init my-blog# 进入文件夹 安装 npmcd my-blognpm install # 安装依赖包 测试123# 测试本地预览(访问 http://localhost:4000)hexo g # 生成静态文件(public文件夹)hexo server 服务器环境准备服务器环境(Ubuntu)12345678910# 登录你的服务器(通过SSH)ssh root@你的服务器IP# 安装必要软件,git 和 nginxsudo apt updatesudo apt install git nginx -y# 创建网站目录并设置权限sudo mkdir -p /var/www/hexosudo chown -R $USER:$USER /var/www/hexo 配置Git12...
Hello World
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





