lnlidawei

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

[cpp]: 常量字符串的声明(const char* const localeName = "zh_CN.utf-8")

 

 

 

 

一、说明

 

  1、编译环境:  g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.83.0-gcc-13.2.0/include -std=gnu++2b

 

  2、声明常量字符串:  【    const char* const localeName = "zh_CN.utf-8"    】

 

 

 

 

二、代码

 1 #include <iostream>
 2 
 3 int main()
 4 {
 5     // constant strings declaration
 6     const char* const localeName = "zh_CN.utf-8" ;
 7 
 8     std::cout << localeName << std::endl ;
 9 
10     return 0 ;
11 }

 

 

三、运行结果

1 g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.83.0-gcc-13.2.0/include -std=gnu++2b
2 
3 
4 
5 zh_CN.utf-8

 

 

四、参考资料

 

  1、  std::filesystem::path::string  --  https://en.cppreference.com/w/cpp/filesystem/path/string

 

posted on 2024-01-29 02:20  lnlidawei  阅读(8)  评论(0编辑  收藏  举报