Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- class Rectangle {
- int width, height;
- public:
- void count_area(int, int);
- int area()
- {
- return width*height;
- }
- };
- void Rectangle::count_area(int x, int y)
- {
- width = x;
- height = y;
- }
- int main() {
- Rectangle rect;
- rect.count_area(5, 3);
- std::cout << rect.area() << std::endl;
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement