cplusplus.com
C++ : Forum : General C++ Programming : how to implement a class hierarchy??
 
cplusplus.com
Information
Documentation
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs


post how to implement a class hierarchy??

andreif8 (2)
Hy there..
i need to implement a class hierarchy to configure the structure of a building..
a building got a nr. of floors,each floor got a nr. of flats,each flat got a nr. of rooms,each room got one door and a nr of windows..so..
1.i need to create a txt file to define the structure of this building
2.i need to read the txt file and to implement a class hierarchy to configure this structure

<building>1
<floor>1
<ap>1
<room>1</room>1
<room>2</room>1
<room>3</room>1
</ap>
<ap>2
<room>1</room>1
<room>2</room>1
</ap>
</floor>

<floor>2
<ap>1
<room>1</room>
<room>2</room>
<room>3</room>
<room>4</room>
</ap>
</floor>

</Bbuilding>

<building>2
<floor>1
<ap>1
<room>1</room>1
<room>2</room>1
<room>3</room>1
</ap>
<ap>2
<room>1</room>1
<room>2</room>1
</ap>
</floor>
</building>

i hope anyone can help me...i'm new in this and i would really appreciate any kind of help...10x's a lot
Bazzy (6258)
Is this what you are looking for?

class building with vector of floors
class floor with vector of rooms
... 
andreif8 (2)
probably...i'm not sure whar method should i use for this problem...
10x's again
firedraco (4744)
Classes containing other classes, exactly what Bazzy said
Topic archived. No new replies allowed.