#include<iostream>
#include <string>
class NoDefault{
public:
  NoDefault(int i){k = i;}
private:
  int k;
};
class C{
public:
//  C(){ a = NoDefault(0);}                       //这个写法是错误的  
  C():a(NoDefault(0)){}                           //换成这个写法是正确的
  
private:
  NoDefault a;
 };
using namespace std;
int main()
{
  C c;

return 0;
}

为什么是错的?????相关推荐

  1. 继承WebMvcConfigurer 和 WebMvcConfigurerAdapter类依然CORS报错? springboot 两种方式稳定解决跨域问题

    继承WebMvcConfigurer 和 WebMvcConfigurerAdapter类依然CORS报错???springboot 两种方式稳定解决跨域问题! 之前我写了一篇文章,来解决CORS报错 ...

  2. Access to XMLHttpRequest at file from origin ‘null‘ has been blocked by CORS policy谷歌浏览器本地打开项目js文件报错

    Access to XMLHttpRequest at 'file:///xxxxx/PQ.BaseInfo.proto' from origin 'null' has been blocked by ...

  3. go build 编译报错 missing go.sum entry for module providing package

    go build 编译报错 missing go.sum entry for module providing package 解决方法 // 移除未使用的依赖 go mod tidy 再次编译,就可 ...

  4. redisson get()数据报错,missing type id property ‘@class’

    redisson get()数据报错: com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Missing type id when ...

  5. docker报错:driver failed programming external connectivity on endpoint, iptables:No chain by that name

    docker 报错: Error response from daemon: Cannot restart container hello: driver failed programming ext ...

  6. mybatis查询报错:com.mysql.cj.exceptions.DataConversionException: Cannot determine value type from string

    mybatis查询报错: com.mysql.cj.exceptions.DataConversionException: Cannot determine value type from strin ...

  7. mongo报错:not authorized on bb to execute command { create: \“xxx\“...}

    mongo报错: {"ok" : 0,"errmsg" : "not authorized on bb to execute command { cr ...

  8. restTemplate http请求报错:no suitable HttpMessageConverter found for response type and content type

    报错信息: org.springframework.web.client.UnknownContentTypeException: Could not extract response: no sui ...

  9. 解决gitte提交报错 error: GE007: Your push would publish a private email address.

    错误情况: gitte提交报错,无法提交上去,报错如下: remote: Powered by GITEE.COM [GNK-6.0] remote: error: GE007: Your push ...

  10. JS Uncaught SyntaxError:Unexpected identifier异常报错原因及其解决方法

    最近在写ajax的时候,调用js方法,遇到了Uncaught SyntaxError:Unexpected identifier异常报错,开始搞不清原因,很苦恼. 以为是js方法参数个数和长度的问题, ...

最新文章

  1. 开发一次、多端覆盖的开源统一框架
  2. Intel Realsense D435 奇怪的现象记录:帧卡住,但wait_for_frame()不报错
  3. verilog中级别到底是什么?级别的分类是什么???
  4. 引用管理器没有程序集_如何使用Zotero插入引用文献
  5. Spring REST:异常处理卷。 2
  6. lwip连续发数据卡死_Mysteel:12月全球铁矿石发运量稳中微增 进口矿咋走?
  7. java 数值变量_Java 中数值变量赋值问题
  8. vue之自行实现派发与广播-dispatch与broadcast
  9. cin java_java基础语法
  10. 2022 chrome离线下载包
  11. 被称为“圣经”的《计算机体系结构》
  12. esp8266 蓝牙耳机_基于Qualcomm QCC3001/TWS迷你型入耳式蓝牙耳机方案
  13. C#验证是不是合法的18位身份证号码
  14. windows10任务栏一直转圈-无法操作假死状态
  15. 编译原理_P1003
  16. 怎样将系统防御升到服务器级别,H3C IPS入侵防御系统 Web配置手册-5PW104
  17. Python-OpenCV——Image Blurring(Image Smoothing)
  18. 多包管理工具Lerna(莱尔纳)
  19. 【java有限状态机选型】
  20. 为什么不能在BroadcastReceiver中开启子线程

热门文章

  1. linq to object 、linq to sql 、linq to entity 批量 新增、更新、删除功能扩展
  2. xdm,把我大学四年能用到的软件都分享给你。
  3. 【Qt】进程间通信之QSharedMemory示例
  4. 【机器视觉】 endswitch算子
  5. 【Ubuntu】 Ubuntu16.04快速搭建环境
  6. 【Linux系统编程】Linux 进程调度浅析
  7. 内省java_Java内省 – 奇怪的行为
  8. js 动态获取表格中的值并修改其他表格+js 动态拼接字符串
  9. 【HDU 1711】Number Sequence(裸KMP算法)
  10. 51nod 1632 B君的连通