#include#include int main() { BRect rect(10, 10, 20, 30); float width = rect.Width(); std::cout << "Width of the rectangle is: " << width << std::endl; return 0; }
#includeIn this example, we have created two BRect objects `rect1` and `rect2` with different coordinates. We then call the `Width()` method of both objects to compare their widths and display a message indicating which rectangle is wider. Package/library: BeOS R5 API (Interface Kit)int main() { BRect rect1(10, 10, 30, 40), rect2(5, 5, 25, 35); bool isGreater = rect1.Width() > rect2.Width(); if(isGreater) { std::cout << "Rectangle 1 is wider than Rectangle 2" << std::endl; } else { std::cout << "Rectangle 2 is wider than Rectangle 1" << std::endl; } return 0; }