The class need to be defined before you can inherit from it. If you have the Address class defined in a header file you can include that header before you define Person.
I'm not really sure why you use inheritance here though. Think about it. Is a person really an address? If you want a person to have an address you should probably use member variable(s) instead (maybe that's what homeNumber and phoneNumber is for?).
Just wondering, could we ask you not to start a new topic if the subject is the same? Just keep the original one going.
Now we have Peter87 spending time & effort in giving the same advice as what was given in the other topic.
I am not trying to be hardcore or anything, more of a gentle suggestion :+). It's just a little irritating to those who reply to a lot of topics in order to help. It happened again to me last week - I did a big long reply, only to discover that the same things had been said the day before. I didn't notice the previous post because it would have been on page 2 or 3 in the forum.
There is no class called Adress, you are inheriting from an imaginary class that you've created in your head that isn't really there. You need to define and declare the "Adress" class you want to inherit from...
And Peter87 gave the exact same advice as what I gave you in the other topic.
My other advice was if you want to practice inheritance, then choose an example that requires inheritance.
Did you read this part?
TheideasMan wrote:
I am not trying to be hardcore or anything, more of a gentle suggestion :+). It's just a little irritating to those who reply to a lot of topics in order to help. It happened again to me last week - I did a big long reply, only to discover that the same things had been said the day before. I didn't notice the previous post because it would have been on page 2 or 3 in the forum.
Sorry I am a bit tired, I don't mean this to be brutal, just a gentle suggestion :+)
yes they have the same idea but they still had some different problems I was trying to learn, but at the same time there was some problems that were the same.
never the less, I understand what your saying, ill try not to do that. Sorry and thanks for the suggestion.