/*-------------------------------------------------------
1. 3 Algorithms to find the smallest sum from consecutive numbers.
-------------------------------------------------------
*/
/*\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
* Alg _ 1, linear,
*\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
*/
class Alg_1{
public:
Alg_1();
~Alg_1();
void solve(const int a1_Arr[],const int length);
int psum();//positive sum
int nsum();//negative sum
private:
int array[];
int location;
...
};
...
void Alg_1::solve(const int a1_Arr[], const int length){
*array = *a1_Arr;
...
};
...
};
int main(){
/**--------------------------------------------------------
4. gets 10 integers from the user and runs the three
algorithms with the same input, with output on the console
--------------------------------------------------------
*/
int temp1;
int simpleA[10];
cout<<"Please type 10 integers, -100 to 100"<<endl;
I can post more code if needed, but my problem is this: although it compiles nice, the array changes inside of the algorithm class. The values are different. Thank you in advance for any direction