I've got an assignment that I am working on, so I am hesitant of posting all of my code on here (for the off chance that my professor somehow would find it - the policy is that would constitute as cheating).
My issue comes at this though: I've got a visual C++ program that has a textbox that takes a user inputs a string, clicks a button, and adds that string to a vector. I then need to pass that vector (full of strings) into a newly created object via its parameterized constructor. There is also some inheritance involved.
basically, in the .h file for the object and the forms .h file, I have the following (as per how the teacher wanted it to be in the object .h file that I am not allowed to change):
typedef vector<string> StringList;
I then create a new parent object and a new vector in the form's .h file:
private: Trial * t;
private: StringList * strings;
then initialize it in the form's constructor:
strings = new StringList;
I then try to create a new instance of a derived class and assign it on the parent object, while passing the required parameters:
t = new Vector_Trial( strings, multi, type );
I get a red line underneath the first parenthesis that says:
Error: no instance of constructor "Vector_Trial::Vector_Trial" matches the argument list
argument types are:(StringList *, int, Trial::TrialType)
The following are the constructors for the parent class and the derived class:
Trial ( StringList & s, int num_runs, TrialType t )
: strings(s), numRuns(num_runs), type(t) { }
Vector_Trial ( StringList & s, int num_runs, TrialType t ) : Trial ( s, num_runs, t ) {}
I'm assuming my issue is with the vector.. Any ideas?