[Solved] I dont understand error “definition of implicity-declared ‘Clothing::Clothing()’


The error is: you declared a destructor but you didn’t define it. Add a definition for the destructor or define it as default:

#ifndef CLOTHING_H_
#define CLOTHING_H_
#include <string>
#include <iostream>

using namespace std;

class Clothing {
private:
    int gender;
    int size;
    string name;

public:
    Clothing();
    Clothing(const Clothing &t);
    Clothing(int gender, int size, string name);
    ~Clothing() = default; // <-- add a default destructor
    int getGender();
    int getSize();
    string getName();
    void setGender(int gender1);
    void setSize(int size1);
    void setName(string name1);
    void print();
    void toString();

};
#endif /* CLOTHING_H_ */

After fixing this your code snippet works: tio.run

If you have more problems with your code, the problems are outside of your provided code snippet.

0

solved I dont understand error “definition of implicity-declared ‘Clothing::Clothing()’