i can see the array in my subclass, but not my sub-subclass. im working on another project and it took me a while to find out that this was the problem...please tell me how to declare this/ where to look to find out.
it compiles but during the run it stops on "signal 11" under eclipse. using the debugger, it was outputting a large number
#include <iostream>
using namespace std;
class myFunc{
public:
myFunc();
void subclass(int* array);
void subsubclass();
private:
int* array;
};
myFunc::myFunc(){
};
void myFunc::subsubclass(){
for (int i=0; i < 10; i++){
cout<<array[i];
}
};
your subclass function is receiving a pointer that is also called array, this is a different "array" from your array member. It should use a different name, and then assign that variable to array.