error C2512: no appropriate default constructor available

后端 未结 4 1728
栀梦
栀梦 2021-01-17 09:26

I am getting this annoying error and I don\'t know why =( ! This is the question , I solved it but I am having a problem with the constructor.

Write a

4条回答
  •  花落未央
    2021-01-17 10:24

    A default constructor is one without any parameters. Normally, it is provided for you. But if you explicitly define any other constructor, then it is not. So you have to define it yourself, or not use it. You are using it when you create an object in main, like this:

    Circle C;
    

    So, either define a default constructor, or don't use it.

提交回复
热议问题