Class help please.

This is a discussion on Class help please. within the C++ Programming forums, part of the General Programming Boards category; I started learning class's and I made this one program and it had so many errors on it. I managed ...

Its because your setWeight function is listed as having no parameters in the class declaration, but in the function definition it has the parameter int weight.

By the way, in the future if you have problems like this, write down the error your compiler gives as well as the code. Many people won't spend the time looking at the code trying to figure out on their own what the bug is.