Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Size
- {
- int m_width;
- int m_height;
- public:
- Size(int width, int height) : m_width(width), m_height(height)
- {
- }
- int getWidth() const
- {
- return m_width;
- }
- int getHeight() const
- {
- return m_height;
- }
- };
- void PrintSize(/*const*/ Size& size) // WORKS IF PARAM IS CONST. NOT A PROBLEM WITH MVCPP
- {
- cout << "Size: " << size.getWidth() << "x" << size.getHeight() << endl;
- }
- int main()
- {
- Size size(16, 9);
- PrintSize(size);
- PrintSize(Size(80, 50));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement