[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
本文由 lnlidawei 原创、整理、转载,本文来自于【博客园】; 整理和转载的文章的版权归属于【原创作者】; 转载或引用时请【保留文章的来源信息】:https://www.cnblogs.com/lnlidawei/p/17993713