#include#include using namespace std; int main() { IntSize size(800, 600); cout << "Width: " << size.width() << endl; cout << "Height: " << size.height() << endl; return 0; }
#includeIn this example, we have a function `resizeObject` that takes an IntSize object by reference, along with new width and height values. Inside the function, we use the `setWidth` and `setHeight` member functions to modify the object's size. This code also uses the IntSize package library.void resizeObject(IntSize& size, int newWidth, int newHeight) { size.setWidth(newWidth); size.setHeight(newHeight); } int main() { IntSize objectSize(100, 100); resizeObject(objectSize, 200, 200); // objectSize now has a width and height of 200 return 0; }