Having some trouble figuring out what this error is.
#include <iostream>
class listSolver{
private:
int arraySize;
int *address;
public:
listSolver(int *arrayAddress, int size);
~listSolver();
int forLoopSolver();
int whileLoopSolver();
int recursiveSolver();
int addNumbers(int *numAddress,int num, int count);
};
listSolver::listSolver(int *arrayAddress,int size){
arraySize = size;
address = arrayAddress;
}
listSolver::~listSolver(){
}
int listSolver::recursiveSolver(){
int *funcAddress = address;
int size = arraySize;
int solution = 0;
return this->addNumbers(funcAddress,size,solution);
}
int addNumbers(int *numAddress,int num, int count){
if(count == 0){
return num+*numAddress;
}
else{
count--;
num+=*numAddress;
numAddress++;
return listSolver::addNumbers(numAddress,num,count);
}
}
g++ compiler gives me
/tmp/ccuy9bHM.o: In function 'listSolver::recursiveSolver()': problem1.cpp:(.text+0x1e2): undefined reference to 'listSolver::addNumbers(int*, int, int)' collect2: error: ld returned 1 exit status
Not sure what it means. Been trying different cominations of calling the function and can't get it to work.