BRect rect(10.0, 20.0, 30.0, 40.0); int width = rect.IntegerWidth();
BRect rect1(0.0, 0.0, 100.0, 50.0); BRect rect2(50.0, 25.0, 150.0, 75.0); int overlap = (rect1 & rect2).IntegerWidth();In this example, we create two BRect objects that overlap partially. We use the & operator to get the intersection of these rectangles and then call IntegerWidth on the resulting rectangle to get the width of the overlap. The BRect class is part of the Interface Kit library in the BeOS/Haiku operating systems.