c++程序—字符串
2024-09-02 11:25:08
- C风格字符串:char 变量名[ ]="字符串值 "
int main()
{ char str[] = "hello world!";
cout << str << endl; system("pause");
return ; }
2. C++风格的字符串:string 变量名 = “字符串值”
- NB:要加一个头文件:
#include<string>
#include<iostream>
using namespace std;
#include<string> int main()
{ string str = "hello world!";
cout << str << endl;
system("pause");
return ; }
最新文章
- WPF 4.0 DatePicker 快速录入
- Python数据类型(3)
- 2016.02.14 总结JS事件
- C#在图片上添加文字代码
- IOS 监听通讯录是否改变
- Effective C++ ——模板和泛型编程
- Java设置session超时(失效)的时间
- nginx反向代理配置两个不同服务器
- 使用Xilinx UART-LITE IP实现串口--逻辑代码实现
- MySql 8.0 C#连接报错 MySql.Data.MySqlClient.MySqlException (0x80004005): Authentication to host &#39;12.118.224.181&#39; for user &#39;root&#39; using method &#39;caching_sha2_password&#39; failed with message: Reading from t
- 汉诺塔III
- hbase-连接流程
- Yii2.0 解决“the requested URL was not found on this server”问题
- 初学java集合框架笔记
- 从零开始自己搭建复杂网络2(以Tensorflow为例)
- WeRun is mini-app
- C#中使用反射遍历一个对象属性和值以及百分数
- Git Step by Step – (6) Git远程仓库
- 用Navicat Premium 操作MySQL数据库
- Struts Ajax Json