Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

I added an underscore to my source code file name and now I got this error "error: definition of explicitly-defaulted ‘book_store::book_store()’ "

This source file book_store.h contains the class book_store but i recently changed the source file book_store.cpp from by adding the "_" between book and store so now i am getting the error described in the title

class book_store
{
    public:

        book_store() = default;
        void read_book_data(string);
        void process_orders(string);
        void print();
        int isbnSort(int []);

    private:
        int book[30];
        int validBooks = 0;

};

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

You probably changed something else.
The error tells you that you have defined your own constructor.

= default tells the compiler to use the default implementation. This also means that you cannot provide your own.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading