博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
现代c++之列表初始化/统一初始化
阅读量:2389 次
发布时间:2019-05-10

本文共 305 字,大约阅读时间需要 1 分钟。

#include #include 
class CDemo {public: int x; int y;};int main(void){ int i = { 0 }; // 普通变量使用列表初始化 int j[] = { 1, 2, 3 }; // 数组使用列表初始化 CDemo d = { 1, 2 }; // 类对象使用列表初始化 CDemo * pd = new CDemo{ 1, 2 }; // 类对象使用列表初始化 std::map
m = { {"a", 1}, {"b", 2} }; // 数据结构使用列表初始化 return 0;}

转载地址:http://jzxab.baihongyu.com/

你可能感兴趣的文章
unittest单元测试框架总结
查看>>
command 'x86_64-linux-gnu-gcc' failed with exit status 1
查看>>
浅谈前端SPA(单页面应用)
查看>>
Insecure default in Elasticsearch enables remote code execution
查看>>
how to use this bugs unserialize()
查看>>
PHP5 Globals Vulnerability
查看>>
关于php包含Apache日志的随想
查看>>
Grep与web漏洞挖掘
查看>>
正则表达式使用详解
查看>>
引用函数magic_quotes_gpc和magic_quotes_runtime的区别和用法(新手推荐)
查看>>
编写不受魔术引号影响的php应用
查看>>
PHP开发安全设置
查看>>
Php Endangers - Remote Code Execution
查看>>
变量的变量,PHP和你
查看>>
PROC系列之四---/proc/loadavg
查看>>
某大型网站的内核TCP/ip优化脚本
查看>>
Defeating SSL using SSLStrip (Marlinspike Blackhat)
查看>>
大型网站数据库架构
查看>>
rdp 安全策略
查看>>
Threat Intelligence Quotient Test
查看>>