You are on page 1of 6

shape.

• #ifndef shape_H
• #define shape_H
• Class shape
• {
• Private:
• Public:
• };
• #endif

C++ Programming: From Problem Analysis to Program Design, Fourth Edition 1


shape.cpp1

• #include "shape.h"
• #include <iostream.h>
• Void shape::‫اسم الوظيفة‬
• {
• Code;
• }

C++ Programming: From Problem Analysis to Program Design, Fourth Edition 2


shape.cpp2

• #include "shape.h"
• #include <iostream.h>
• Void main()
• {
• Object declaration;
• Access by object;
• }

C++ Programming: From Problem Analysis to Program Design, Fourth Edition 3


rect.h
• #ifndef rect_H
• #define rect_H

• #include "shape.h" ←
• Class rect:public shape
• {
• Private:
• Declaration variable;
• Public:
• Function prototypy;
• };
• #endif

C++ Programming: From Problem Analysis to Program Design, Fourth Edition 4


rect.cpp1

• #include "rect.h"
• #include <iostream.h>
• Void rect::‫اسم الوظيفة‬
• {
• Code;
• }

C++ Programming: From Problem Analysis to Program Design, Fourth Edition 5


Rect.cpp2

• #include "rect.h"
• #include <iostream.h>
• Void main()
• {
• Object declaration;
• Access by object;
• Access by object to ovirrid;
• }

C++ Programming: From Problem Analysis to Program Design, Fourth Edition 6

You might also like