LayoutRect rect(0, 0, 100, 100); rect.setX(50);
void moveRect(LayoutRect& rect, int x) { rect.setX(x); } int main() { LayoutRect rect(0, 0, 100, 100); moveRect(rect, 50); return 0; }In this example, we define a function `moveRect` that takes a LayoutRect object and an X position as arguments and sets the X position of the LayoutRect object to the provided value. We then create a LayoutRect object and call the `moveRect` function with an X position of 50. Package library: This code example is using the LayoutRect class, which is likely part of a larger library or framework for building UIs, such as Qt or WinForms.