没有给出与所需形式参数相对应的参数 [英] There is no argument given that corresponds to the required formal parameter

查看:76
本文介绍了没有给出与所需形式参数相对应的参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对这个错误一无所知,请问我该如何工作?

I don't have any idea about this error please how I make that work?

推荐答案

出现此错误是因为基类没有默认构造函数.您需要在派生类中定义一个构造函数,该构造函数获得与基类中的构造函数相同的参数,并使用 base 关键字调用该基类构造函数,如

The error appears because the base class does not have a default constructor. You need to define a constructor in the derived class, which gets the same parameters as the constructor in the base class, and invokes that base class constructor using the base keyword as explained here

这篇关于没有给出与所需形式参数相对应的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆