Здесь так много неправильных вещей, поэтому давайте сделаем это медленно:
TwoSeries::TwoSeries(const int& size, const int& a0, const int& b0)
{
int arrayA [size]; //no way this compiles without new [] operator
int arrayB [size]; //also why you name identical local variable with the same name as your private data members?
arrayA[0] = a0; //so you initialize the first member with some value
arrayB[0] = b0; //and then all the other values to -1 is this intended?
int *aArray = getArrayA(); //why are you doing this?
int *bArray = getArrayB(); // you can access the data member by using this->arrayA; even without the this, but since you have identical name with locals you need the "this"
for(int x = 1; x < 200; x++)
{
*(aArray + x) = -1; //avoid pointer arithmetic, it's error prone
*(bArray + x) = -1; //do this instead bArray[x] = -1;
}
}
Далее:
int TwoSeries :: getA (int & index) {// Я думаю, вы хотитевернуть элемент из массива?вернуть массивA [index];// подвержен ошибкам, проверяем, находится ли индекс между границами и положительным. return 0;}
Далее:
int* TwoSeries::getArrayA()
{
//int * pointer = arrayA; //not needed
return arrayA;
}
int* TwoSeries::getArrayB()
{
//int * pointer = arrayB; //same as above
return arrayB;
}
Далее:
string TwoSeries::getArrays()
{
ostringstream outString;
string stA;
string stB;
string valueA;
for(int x = 0; x < 200; x++)
{
outString << x;
string index = outString.str();
//int *arrayA = getArrayA(); //same mistake as before
//outString << *(arrayA + 1); //you realize you always access the same element right?
outString << arrayA[x]; //I guess this is what you wanted?
valueA = outString.str();
int * arrayB = getArrayB(); // see above
outString << getArrayB() + x;
string valueB = outString.str();
// stA += index + ":" + valueA + " ";
// stB += index + ":" + valueB + " ";
}
// return "Series A: \n"+stA+ "/n"+"Series B: \n"+ stB;
return valueA;
}
Возможно, здесь скрыто больше ошибок.Но вы опубликовали что-то, что даже не компилируется, поэтому мы не можем действительно помочь вам.