: error C2597: illegal reference to non-static member 'Disks::disks'

1) I am not sure if I am using the test method successfully in this program. I need to test
the recursion to make sure it’s working accurately. I am not sure how to test this before
it prints because I am having issues passing the data.
2) So I tested it after to at least print if the function worked successfully by making it to the
base case. However, I am having one error:

if(Disks::disks == 1) will work only if the disks is a static variable, i.e.

class Disks
{
...
static int disks;
...
};

If it's not feasible to have it as static, then you need an Disks object, i.e.

void some_function(Disks & aDisk)
{
if(aDisk.disks == 1)
...

I'm sorry I'm confused. I think I know what you are saying but I do not know how to implement it. And also why would I have some other functions. And if I have a reference then I need to initialize it.

I'm sorry I'm confused. I think I know what you are saying but I do not know how to implement it. And also why would I have some other functions. And if I have a reference then I need to initialize it.

I don't see a call to the test() function so I don't know what you are trying to do and why. Therefore I can't suggest a way to implement it. I see you have this function as static and not as a member of the Disk class. I can think of ways to make it compile, but since don't understand exactly what you are testing, I don't know what the purpose of the ToH class is and why you have chosen to make the test() function static. If you're not sure why you want to have it be static and you're not sure what static means, I'd make it not be static. And is there any reason you are creating a class to test this rather than just a plain old function?

I don't see a call to the test() function so I don't know what you are trying to do and why. Therefore I can't suggest a way to implement it. I see you have this function as static and not as a member of the Disk class. I can think of ways to make it compile, but since don't understand exactly what you are testing, I don't know what the purpose of the ToH class is and why you have chosen to make the test() function static. If you're not sure why you want to have it be static and you're not sure what static means, I'd make it not be static. And is there any reason you are creating a class to test this rather than just a plain old function?

because we were asked to do this - I need to create another class to use the test method to check the recursion.

Ok well I got it to work, however, not using a reference. The following is my current code. However, I do not feel the test is effective because in the function Disks::towers you would figure that disks, and hence finalDisks would end at 1, but instead there are 3 left? Doesn’t make sense if it reached the base case.