I have this code where I need to add the inches and feet together to 1 number. I have to use int CDistance::add(const CDistance&) const to do it though. But when I have this I can't put d1.add() in main. Now when I take out const CDistance& total) it works. How do you do it with the whole thing in there?
You declared member function add as having one parameter but you are trying to call it without any argument. So the compiler issues an error because the number of arguments does not correspond to the number of parameters.