1. 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 ; }

最新文章

  1. WPF 4.0 DatePicker 快速录入
  2. Python数据类型(3)
  3. 2016.02.14 总结JS事件
  4. C#在图片上添加文字代码
  5. IOS 监听通讯录是否改变
  6. Effective C++ ——模板和泛型编程
  7. Java设置session超时(失效)的时间
  8. nginx反向代理配置两个不同服务器
  9. 使用Xilinx UART-LITE IP实现串口--逻辑代码实现
  10. 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
  11. 汉诺塔III
  12. hbase-连接流程
  13. Yii2.0 解决“the requested URL was not found on this server”问题
  14. 初学java集合框架笔记
  15. 从零开始自己搭建复杂网络2(以Tensorflow为例)
  16. WeRun is mini-app
  17. C#中使用反射遍历一个对象属性和值以及百分数
  18. Git Step by Step – (6) Git远程仓库
  19. 用Navicat Premium 操作MySQL数据库
  20. Struts Ajax Json

热门文章

  1. topthink/think-swoole 扩展包的使用 之 WebSocket
  2. leetcode LRU缓存机制(list+unordered_map)详细解析
  3. MariaDB——数据库集群
  4. 学习笔记:中国剩余定理(CRT)
  5. vue通过路由传值及在页面刷新后如何保存值
  6. Linux 下JDK安装
  7. 小程序通过web-view实现与h5页面之间的交互
  8. 基于RabbitMQ的MQTT协议及应用
  9. DB2常用sql语句
  10. RAM和ROM的区别