I've created a program that reads in data from a file and creates objects from them. However their values can vary and thus I made an array that can expand to a definite amount. When I try to pass said through the constructor I run into some trouble. Also I'm not supposed to use vectors which from what I understand would have made this a lot easier.
//bunch of code to read in data from the file similar to this below
getline (readfile, typea);
//code determining what each data type is.
readMedia >>NSA_Value;
for (int i=0; i<=NSA_Value; i++){
getline(readMedia, supporting_actorsa[i]); //this is the array I'm using that can grow a bit to accommodate.
Vhs initial = Vhs(typea, a, b, c, supporting_actorsa[10]); //the constructor ive removed most of the other things to make it more readable.
This is the cpp file it calls on create the object
#include "Vhs.cpp"
Vhs::Vhs (string type, string a1, string b1, string c1, supporting_actorsa1[10])
{
}
Vhs::Vhs(void)
{
}
Vhs::~Vhs(void)
{
}
and this it it's .h file
#pragma once
class Vhs
{
public:
Vhs(void);
Vhs (string type, string A2, string B2, string C3, string supporting_actorsA3[10]);
~Vhs(void);
};
all the variables exist, i just removed all the declarations to make things look cleaner. Thanks for any help