hi everyone!i'm working on a project and i'm getting two errors of the type mentioned in the title.
here's the part of the code that generates the problem:
#include "Instance.h"
//default constructor
Instance::Instance(unsigned features) {
num_of_features = features;
fileName = "-";
category = true;
keywords = new string[num_of_features];
featureID = new unsigned[num_of_features];
frequency = new unsigned[num_of_features];
for (unsigned i = 0; i < num_of_features; i++)
{
keywords[i] = "-";
featureID[i] = 0;
frequency[i] = 0;
}
}
//...
void Instance::setFeature(unsigned i, const string& feature, unsigned featureID, unsigned frequency) {
keywords[i] = feature;
featureID[i] = featureID;
frequency[i] = frequency;
}
everything's declared in a header file:
class Instance {
public:
Instance(unsigned features=0);
Instance(const Instance& original);
void setFeature(unsigned i, const string& feature, unsigned featureID, unsigned frequency);
private:
string fileName;
string* keywords;
unsigned* featureID;
unsigned* frequency;
unsigned num_of_features;
bool category;
};
the error appears in line 22 and 23 of the cpp file.
i've already searched similar topics but they didn't turn out to be very helpful..i would really appreciate any help!
thanks in advance